Part Number Hot Search : 
MM5Z11 A78T15 BD87A41 5MT750 12N10 1N5996B MM1311 ZM2CR53W
Product Description
Full Text Search
 

To Download 71M6541D-IGTRF Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  19-5376; rev 5; 1/15 for pricing, delivery, and ordering information, please contact maxim dir ect at 1-888-629-4642, or visit maxim integrated?s website at www.maximinte grated.com. 71m6541d/f/g and 71m6542f/g energy meter ics general description the 71m6541d/71m6541f/71m6541g/71m6542f/71m6542g (7 1m654x) are 4th-generation single-phase metering socs with a 5m hz 8051- compatible mpu core, low-power rtc with digital tem perature compensation, flash memory, and lcd driver. our sin gle converter technology? with a 22-bit delta-sigma adc, three or four analog inputs, digital temperature compensation, precision voltage reference, and a 32-bit computation engine (ce) sup ports a wide range of metering applications with very few extern al components. the 71m6541/2 devices support optional interfaces t o the 71m6x01 series of isolated sensors, which offer bom cost re duction, immunity to magnetic tamper, and enhanced reliability. other features include an spi interface, advanced power management, ultra- low-power operation in active and battery modes, 3/5kb shared ram and 32/64/128kb of flash memory that can be programmed in the field with code and/or data during meter operation and th e ability to drive up to six lcd segments per seg driver pin. high pro cessing and sampling rates combined with differential inputs of fer a powerful metering platform for residential meters. a complete array of code development tools, demonst ration code, and reference designs enable rapid development and certification of meters that meet all ansi and iec electricity meter ing standards worldwide. the 71m654x family operates over the industrial tem perature range and comes in 64-pin (71m6541d/f/g) and 100-pin (71m 6542f/g) lead(pb)-free lqfp packages. mpu rtc timers iap va ibp xin xout rx tx tx rx com0...5 v3p3a v3p3sys vbat vbat_rtc seg gnda gndd seg/dio dio ice line neutral load  pulses, dio ir amr power fault comparator modul- ator serial ports oscillator/ pll mux and adc lcd driver dio, pulses compute engine flash memory ram 32 khz regulator shunt power supply 71m6541d/f/g temperature sensor vref battery pwr mode control wake-up neutral i 2 c or wire eeprom ian ibn rtc battery v3p3d battery monitor spi interface host lcd display resistor divider pulse trans- former 71m6xx1 shunt line line note: this system is referenced to line 11/5/2010 benefits and features ? soc integration and unique isolation technique reduces bom cost without sacrificing performance ? 0.1% typical accuracy over 2000:1 current range ? exceeds iec 62053/ansi c12.20 standards ? four-quadrant metering ? 46-64hz line frequency range with the same calibration ? phase compensation (10) ? independent 32-bit compute engine ? 32kb flash, 3kb ram (71m6541d) ? 64kb flash, 5kb ram (71m6541f/42f) ? 128kb flash, 5kb ram (71m6541g/42g) ? built-in flash security ? spi interface for flash program capability ? up to four pulse outputs with pulse count ? 8-bit mpu (80515), up to 5 mips ? full-speed mpu clock in brownout mode ? lcd driver allows up to 6 commons/up to 56 pins ? 5v lcd driver with dac ? up to 51 multifunction dio pins ? hardware watchdog timer (wdt) ? two uarts for ir and amr ? ir led driver with modulation ? innovative isolation technology (requires companion 71m6xxx sensor, also from maxim integrated) eliminates current transformers ? two current sensor inputs with selectable differential mode ? selectable gain of 1 or 8 for one current input to support shunts ? high-speed wh/varh pulse outputs with programmable width ? digital temperature compensation improves system performance ? metrology compensation ? accurate rtc for tou functions with automatic temperature compensation for crystal in all power modes ? power management extends battery life during power outages ? three battery-backup modes: o brownout mode (brn) o lcd mode (lcd) o sleep mode (slp) ? wake-up on pin events and wake-on timer ? 1  a in sleep mode single converter technology is a registered tradema rk of maxim integrated products, inc. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 2 rev 5 table of contents 1 introduction ....................................................................................................................................... 10 2 hardware description ....................................................................................................................... 11 2.1 hardware overview ................................................................................................................... 11 2.2 analog front end (afe) ............................................................................................................. 12 2.2.1 signal input pins ............................................................................................................ 14 2.2. 2 input multiplexer ............................................................................................................. 15 2.2.3 delay compensation ..................................................................................................... 19 2.2.4 adc pre - amplifier ......................................................................................................... 20 2.2.5 a/d converter (adc) ..................................................................................................... 20 2.2.6 fir filter ........................................................................................................................ 20 2.2.7 vo ltage references ....................................................................................................... 20 2.2.8 71m6x01 isolated sensor interface (remote sensor interface) ................................... 22 2.3 digital computation engine (ce) ............................................................................................... 24 2.3.1 ce program memory ..................................................................................................... 24 2.3. 2 ce data memory ........................................................................................................... 24 2.3.3 ce communication with the mpu ................................................................................. 25 2.3.4 meter equations ............................................................................................................. 25 2.3.5 real - time monitor (rtm) .............................................................................................. 25 2.3.6 pulse generators ........................................................................................................... 27 2.3.7 ce functional overview ................................................................................................ 28 2.4 80515 mpu core ....................................................................................................................... 31 2.4.1 memory organization and addressing .......................................................................... 31 2.4.2 special function registers (sfrs) ................................................................................ 33 2.4.3 generic 80515 special function registers ................................................................... 34 2.4.4 instruction set ................................................................................................................ 37 2.4.5 uarts ........................................................................................................................... 37 2.4.6 timers and counters ..................................................................................................... 39 2.4.7 wd timer (software watchdog timer) ......................................................................... 41 2.4.8 interrupts ........................................................................................................................ 41 2.5 on - chip resources ................................................................................................................... 48 2.5.1 physical memory ............................................................................................................ 48 2.5.2 oscillator ........................................................................................................................ 50 2.5.3 pll and internal clocks ................................................................................................ . 50 2.5.4 real - time clock (rtc) ................................................................................................ . 51 2.5.5 71m654x temperature sensor ...................................................................................... 56 2.5.6 71m654x battery monitor ............................................................................................... 57 2.5.7 uart and optical interfa ce ........................................................................................... 58 2.5.8 digital i/o and lcd segment drivers ............................................................................ 59 2.5.9 eeprom interface ........................................................................................................ 70 2.5.10 spi slave port ................................................................................................................ 73 2.5.11 hardware watchdog timer ............................................................................................ 78 2.5.12 test ports (tmuxout and tmux2out pins) ............................................................. 78 3 functional description ..................................................................................................................... 80 3.1 theory of operation ................................................................................................................... 80 3.2 battery modes ............................................................................................................................ 81 3.2.1 brn mode ..................................................................................................................... 83 3.2.2 lcd mode ...................................................................................................................... 83 3.2.3 slp mode ...................................................................................................................... 84 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 3 3.3 fault and reset behavior .......................................................................................................... 85 3.3.1 events at power - down .................................................................................................. 85 3.3.2 ic behavior at low battery voltage ............................................................................... 86 3.3.3 reset sequence ............................................................................................................ 86 3.3.4 watchdog timer reset .................................................................................................. 86 3.4 wake up behavior ..................................................................................................................... 87 3.4.1 wake on hardware events ............................................................................................ 87 3.4.2 wake on timer ............................................................................................................... 90 3.5 data flow and mpu/ce communication ................................................................................... 91 4 application information .................................................................................................................... 92 4.1 connecting 5 v devices ............................................................................................................. 92 4.2 direct connection of sensors .................................................................................................... 92 4.3 71m6541d/f/g using local sensors ........................................................................................ 93 4.4 71m6541d/f/g using 71m6x01and current shunts ................................................................ . 94 4.5 71m6542f/g using local sensors ............................................................................................ 95 4.6 71m6542f/g using 71m6x01 and current shunts ................................................................... 96 4.7 metrology temperature compensation ..................................................................................... 97 4.7.1 voltage reference precision ......................................................................................... 97 4.7.2 temperature coefficients for the 71m654x ................................................................... 97 4.7.3 temperature compensation for vref with local sensors ........................................... 98 4.7.4 temperature compensation for vref with remote sensor ........................................ 99 4.8 connecting i 2 c eeproms ...................................................................................................... 100 4.9 connecting three - wire eeproms ......................................................................................... 101 4.10 uart0 (tx/rx) ....................................................................................................................... 101 4.11 optical interface (uart1) ........................................................................................................ 101 4.12 connecting the reset pin ........................................................................................................ 102 4.13 connecting the emulator port pins .......................................................................................... 103 4.14 flash programming .................................................................................................................. 104 4.14.1 flash programming via the ice port ........................................................................... 104 4.14.2 flash programming via the spi port ........................................................................... 104 4.15 mpu firmware library ............................................................................................................. 104 4.16 crystal oscillator ...................................................................................................................... 104 4.17 meter calibration ...................................................................................................................... 104 5 firmware interface .......................................................................................................................... 105 5.1 i/o ram map C functional order ............................................................................................. 105 5.2 i/o ram map C alphabetical order ......................................................................................... 111 5.3 ce interface description .......................................................................................................... 126 5.3.1 ce program ................................................................................................................. 126 5.3.2 ce data format ........................................................................................................... 126 5.3.3 constants ..................................................................................................................... 126 5.3.4 environment ................................................................................................................. 127 5.3.5 ce calculations ........................................................................................................... 127 5.3.6 ce front end data (raw data) ................................................................................... 128 5.3.7 fce status and control ............................................................................................... 128 5.3.8 ce transfer variables ................................................................................................ . 131 5.3.9 pulse generation ......................................................................................................... 133 5.3.10 other ce parameters .................................................................................................. 135 5.3.11 ce calibration parameters .......................................................................................... 136 5.3.12 ce flow diagrams ....................................................................................................... 137 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 4 rev 5 6 electrical specifications ................................................................................................................. 139 6.1 absolute maximum ratings ..................................................................................................... 139 6.2 recommended external components ..................................................................................... 140 6.3 recommended operating conditions ...................................................................................... 140 6.4 performance specifications ..................................................................................................... 141 6.4.1 input logic levels ........................................................................................................ 141 6.4.2 output logic levels ..................................................................................................... 141 6.4.3 battery monitor ............................................................................................................. 142 6.4.4 temperature monitor ................................................................................................... 142 6.4.5 supply current ............................................................................................................. 143 6.4.6 v3p3d switch .............................................................................................................. 144 6.4.7 internal power fault comparators ............................................................................... 144 6.4.8 2.5 v voltage regulator C system power ................................................................... 144 6.4.9 2.5 v voltage regulator C battery power .................................................................... 145 6.4.10 crystal oscillator .......................................................................................................... 145 6.4.11 phase - locked loop (pll) ........................................................................................... 145 6.4.12 lcd drivers ................................................................................................................. 146 6.4.13 vlcd generator .......................................................................................................... 147 6.4.14 vref ........................................................................................................................... 149 6.4.15 adc converter ............................................................................................................. 150 6.4.16 pre - amplifier for iap - ian ............................................................................................. 151 6.5 timing specifications ............................................................................................................... 152 6.5.1 flash memory .............................................................................................................. 152 6.5.2 spi slave ..................................................................................................................... 152 6.5.3 eeprom interface ...................................................................................................... 152 6.5.4 reset pin ................................................................................................................... 153 6.5.5 rtc .............................................................................................................................. 153 6.6 package outline drawings ....................................................................................................... 154 6.6.1 64 - pin lqfp outline package drawing ...................................................................... 154 6.6.2 100 - pin lqfp package outline drawing .................................................................... 155 6.7 package markings ................................................................................................................... 156 6.8 pinout diagrams ...................................................................................................................... 157 6.8.1 71m6541d/f/g lqfp - 64 package pinout .................................................................. 157 6.8.2 71m6542f/g lqfp - 100 package pinout .................................................................... 158 6.9 pin descriptions ....................................................................................................................... 159 6.9.1 power and ground pins ............................................................................................... 159 6.9.2 analog pins .................................................................................................................. 160 6.9.3 digi tal pins ................................................................................................................... 161 6.9.4 i/o equivalent circuits ................................................................................................ . 163 7 ordering information ...................................................................................................................... 164 7.1 71m6541d/f/g and 71m6542f/g ........................................................................................... 164 8 related information ........................................................................................................................ 164 9 contact information ........................................................................................................................ 164 appendix a: acronyms .......................................................................................................................... 165 appendix b: revision history ................................................................................................................ 166 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 5 figures figure 1: ic functional block diagram ......................................................................................................... 9 figure 2. 71m6541d/f/g afe block diagram (local sensors) ................................................................ . 12 figure 3. 71m6541d/f/g afe block diagram with 71m6x01 .................................................................... 13 figure 4. 71m6542f/g afe block diagram (local sensors) ..................................................................... 13 figure 5. 71m6542f/g afe block diagram with 71m6x01 ........................................................................ 14 figure 6: states in a multiplexer frame ( mux_div[3:0] = 3) ..................................................................... 17 figure 7: states in a multiplexer frame ( mux_div[3:0] = 4) ..................................................................... 17 figure 8: general topology of a chopped amplifier .................................................................................. 21 figure 9: cross signal with chop_e = 00 ............................................................................................... 21 figure 10: rtm timing ............................................................................................................................... 26 figure 11: timing relationship between adc mux, ce, and rtm serial transfer .................................. 26 figure 12. pulse generator fifo timing .................................................................................................... 28 figure 13: accumulation interval ................................................................................................................ 29 figure 14: samples from multiplexer cycle ( mux_div[3:0] = 3) ............................................................... 30 figure 15: samples from multiplexer cycle ( mux_div[3:0] = 4) ............................................................... 30 figure 16: interrupt structure ...................................................................................................................... 47 figure 17: automatic temperature compensation ..................................................................................... 54 figure 18: optical interface ......................................................................................................................... 58 figure 19: optical interface (uart1) ......................................................................................................... 59 figure 20: connecting an external load to dio pins ................................................................................. 60 figure 21: lcd waveforms ......................................................................................................................... 68 figure 22: 3 - wire interface. write command, hiz=0. ............................................................................... 72 figure 23: 3 - wire interface. write command, hiz=1 ................................................................................ 72 figure 24: 3 - wire interface. read command. ........................................................................................... 72 figure 25: 3 - wire interface. write command when cnt=0 ...................................................................... 73 figure 26: 3 - wire interface. write command when hiz=1 and wfr=1. .................................................. 73 figure 27: spi slave port - typical multi - byte read and write operations ............................................... 75 figure 28: voltage, current, momentary and accumulated energy ........................................................... 80 figure 29: operation modes state diagram ............................................................................................... 81 figure 30: mpu/ce data flow .................................................................................................................... 91 figure 31: resistive voltage divider (voltage sensing) ............................................................................. 92 figure 32. ct with single - ended input connection (current sensing) ...................................................... 92 figure 33: ct with differential input connection (current sensing) .......................................................... 92 figure 34: differentia l resistive shunt connections (current sensing) ..................................................... 92 figure 35. 71m6541d/f/g with local sensors ........................................................................................... 93 figure 36: 71m6541d/f/g with 71m6x01 isolated sensor ......................................................................... 94 figure 37: 71m6542f/g with local sensors ............................................................................................... 95 figure 38: 71m6542f/g with 71m6x01 isolated sensor ............................................................................ 96 figure 39: i 2 c eeprom connection ........................................................................................................ 100 figure 40: connections for uart0 ........................................................................................................... 101 figure 41: connection for optical components ........................................................................................ 102 figure 42: external components for the reset pin: push - button (left), production circuit (right) ......... 102 figure 43: external components for the emulator interface .................................................................... 103 figure 44: ce data flow: multiplexer and adc ........................................................................................ 137 figure 45: ce data flow: scaling, gain control, intermediate variables ................................................ 137 figure 46: ce data flow: squaring and summation stages .................................................................... 138 figure 47: 64 - pin lqfp package outline ................................................................................................ . 154 figure 48: 100 - pin lqfp package outline ............................................................................................... 155 figure 49. package markings (examples) ................................................................................................ 156 figure 50: pinout for the 71m6541d/f/g (lqfp - 64 package) ................................................................ . 157 figure 51: pinout for the 71m6542f/g (lqfp - 100 package) .................................................................. 158 figure 52: i/o equivalent circuits ............................................................................................................. 163 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 6 rev 5 tables table 1. required ce code and settings for local sensors ...................................................................... 15 table 2. required ce code and settings for 71m6x01 isolated sensor ................................................... 16 table 3: adc input configuration .............................................................................................................. 17 table 4: multiplexer and adc configuration bits ....................................................................................... 19 table 5. rcmd[4:0] bits ............................................................................................................................. 23 table 6: remote interface read commands ............................................................................................ 23 table 7: i/o ram control bits for isolated sensor .................................................................................... 23 table 8: inputs selected in multiplexer cycles ........................................................................................... 25 table 9: ckmpu clock frequencies .......................................................................................................... 31 table 10: memory map ............................................................................................................................... 32 table 11: internal data memory map ......................................................................................................... 33 table 12: special function register map ................................................................................................... 33 table 13: generic 80515 sfrs - location and reset values .................................................................... 34 table 14: psw bit functions ( sfr 0xd0 ) ..................................................................................................... 35 table 15: port registers (segdio0 - 15) ..................................................................................................... 36 table 16: stretch memory cycle width ...................................................................................................... 36 table 17: baud rate generation ................................................................................................................ 37 table 18: uart modes ............................................................................................................................... 37 table 19: the s0con (uart0) register (sfr 0x98) ................................................................................. 38 table 20: the s1con (uart1) register (sfr 0x9b) ................................................................................ 39 table 21: pcon register bit description (sfr 0x87) ............................................................................... 39 table 22: timers/counters mode description ............................................................................................ 40 table 23: allowed timer/counter mode combinations .............................................................................. 40 table 24: tmod register bit description (sfr 0x89) ................................................................................ 40 table 25: the tcon register bit functions (sfr 0x88) ............................................................................ 41 table 26: the ien0 bit functions (sfr 0xa8) ............................................................................................ 42 table 27: the ien1 bit functions (sfr 0xb8) ............................................................................................ 42 table 28: the ien2 bit functions (sfr 0x9a) ............................................................................................ 42 table 29: tcon bit functions (sfr 0x88) ................................................................................................ . 42 table 30: the t2con b it functions (sfr 0xc8) ....................................................................................... 43 table 31: the ircon bit functions (sfr 0xc0) ........................................................................................ 43 table 32: external mpu interrupts .............................................................................................................. 44 table 33: interrupt enable and flag bits ................................................................................................... 45 table 34: interrupt priority level groups .................................................................................................... 45 table 35: interrupt priority levels ............................................................................................................... 45 table 36: interrupt priority registers ( ip0 and ip1 ) .................................................................................... 46 table 37: interrupt polling sequence .......................................................................................................... 46 table 38: interrupt vectors .......................................................................................................................... 46 table 39: flash memory access ................................................................................................................. 48 table 40: flash security ............................................................................................................................. 49 table 41: clock system summary .............................................................................................................. 51 table 42: rtc control registers ................................................................................................................ 52 table 43: i/o ram registers for rtc temperature compensation .......................................................... 53 table 44: nv ram temperature table structure ....................................................................................... 54 table 45: i/o ram registers for rtc interrupts ........................................................................................ 55 table 46: i/o ram registers for temperature and battery measurement ................................................ 56 table 47: selectable resources using the dio_rn[2:0] bits ..................................................................... 60 table 48: data/direction registers for segdio0 to segdio14 (71m6541d/f/g) ................................... 61 table 49: data/direction registers for segdio19 to segdio27 (71m6541d/f/g) ................................ . 62 table 50: data/direction registers for segdio36 - 39 to segdio44 - 45 (71m6541d/f/g) ....................... 62 table 51: data/direction registers for segdio51 and segdio55 (71m6541d/f/g) .............................. 62 table 52: data/direction registers for segdio0 to segdio15 (71m6542f/g) ....................................... 63 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 7 table 53: data/direction registers for segdio16 to segdio31 (71m6542f/g) ..................................... 64 table 54: data/direction registers for segdio32 to segdio45 (71m6542f/g) ..................................... 64 table 55: data/direction registers for segdio51 to segdio55 (71m 6542f/g) ..................................... 64 table 56: lcd_vmode[1:0] configurations .............................................................................................. 65 table 57: lcd configurations .................................................................................................................... 67 table 58: 71m6541d/f/g lcd data registers for seg46 to seg50 ........................................................ 69 table 59: 71m6542f/g lcd data registers for seg46 to seg50 ........................................................... 70 table 60: eectrl bits for 2 - pin interface ................................................................................................... 71 tabl e 61: eectrl bits for the 3 - wire interface .......................................................................................... 71 table 62: spi transaction fields ................................................................................................................ 74 table 63: spi command sequences .......................................................................................................... 75 table 64: spi registers .............................................................................................................................. 76 table 65: tmux[5:0] selections ................................................................................................................. 79 table 66: tmux2[4:0] selections ............................................................................................................... 79 table 67: available circuit functions .......................................................................................................... 82 table 68: vstat[2:0] (sfr 0xf9[2:0]) ......................................................................................................... 85 table 69: wake enables and flag bits ....................................................................................................... 88 table 70: wake bits .................................................................................................................................... 89 table 71: clear events for wake flags ...................................................................................................... 90 table 72: gain_adjn compensation channels ........................................................................................ 98 table 73: gain_adjn compensation channels ...................................................................................... 100 table 74: i/o ram map C functional order, basic configuration ............................................................ 105 table 75: i/o ram map C functional order ............................................................................................. 107 table 76: i/o ram map C functional order ............................................................................................. 111 table 77. standard ce codes .................................................................................................................. 126 table 78: ce equ equations and element input mapping ...................................................................... 127 table 79: ce raw data access locations ............................................................................................... 128 table 80: cestatus register ................................................................................................................... 128 table 81: cestatus ( ce ram 0x80 ) bit definitions .................................................................................. 129 table 82: ceconfig register .................................................................................................................. 129 table 83: ceconfig ( ce ram 0x20 ) bit definitions ................................................................................. 129 table 84: sag threshold and gain adjust control ................................................................................... 130 table 85: ce transfer variables (with local sensors) ............................................................................. 131 table 86: ce transfer variables (with remote sensor) ........................................................................... 131 table 87: ce energy measurement variables (with local sensors) ........................................................ 132 tabl e 88: ce energy measurement variables (with remote sensor) ..................................................... 132 table 89: other transfer variables ........................................................................................................... 133 table 90: ce pulse generation parameters ............................................................................................. 134 table 91: ce parameters for noise suppression and code version ....................................................... 135 table 92: ce calibration parameters ....................................................................................................... 136 table 93: absolute maximum ratings ...................................................................................................... 139 table 94: recommended external components ...................................................................................... 14 0 table 95: recommended operating conditions ....................................................................................... 140 table 96: input logic levels ..................................................................................................................... 141 table 97: output logic levels .................................................................................................................. 141 table 98: battery monitor performance specifications ( temp_bat = 1) .................................................. 142 table 99. temperature monitor ................................................................................................................ 142 table 100: supply current performance specifications ........................................................................... 143 table 101: v3p3d switch performance specifications ............................................................................ 144 table 102. internal power fault comparator specifications .................................................................... 144 table 103: 2.5 v voltage regulator performance specifications ............................................................. 144 table 104: low - power voltage regulator performance specifications ................................................... 145 table 105: crystal oscillator performance specifications ........................................................................ 145 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 8 rev 5 table 106: pll performance spe cifications ............................................................................................. 145 table 107: lcd driver performance specifications ................................................................................. 146 table 108: lcd driver performance specifications 1 ................................................................................ 147 table 109: vref performance specifications .......................................................................................... 149 table 110. adc converter performance specifications ........................................................................... 150 table 111: pre - amplifier performance specifications .............................................................................. 151 table 112: flash memory timing specifications ...................................................................................... 152 table 113. spi slave timing specifications ............................................................................................. 152 table 114: eeprom interface timing ...................................................................................................... 152 table 115: reset pin timing .................................................................................................................. 153 table 116: rtc range for date ............................................................................................................... 153 table 117. 71m6541 package markings .................................................................................................. 156 table 118. 71m6542 package markings .................................................................................................. 156 table 119: power and ground pins .......................................................................................................... 159 table 120: analog pins ............................................................................................................................. 160 table 121: digital pins .............................................................................................................................. 161 table 122. ordering information ............................................................................................................... 164 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 9 iap mux and preamp xin xout vref ckadc ce 32-bit compute engine mpu (80515) ce control opt_rx/ segdio55 opt_tx/ segdio51/ wpulse/ varpulse reset vbias emulator port 3 ce_busy optical interface uart0 tx rx xfer busy 6 com0..5 vlc2 lcd driver cedata 0x000...0x2ff prog 0x000...0x3ff data 0x0000...0xffff program 0x0000...0xffff 0x0000 0xffff digital i/o configuration ram (i/o ram) 0x2000...0x20ff i/o ram memory share 0x0000...0x13ff 16 8 rtclk rtclk (32khz) mux_sync ckce ckmpu ck32 32 8 8 8 power fault detection 4.9 mhz < 4.9mhz 4.9 mhz gndd v3p3a v3p3d vbat voltage regulator 2.5v to logic vdd 32khz mpu_rstz faultz wake con- figuration parameters gnda vbias 10/11/2011 cross clock gen oscillator 32 khz ck32 mck pll vref div adc mux ctrl strt mux mux ckfir rtm segdio pins wpulse varpulse wpulse varpulse test test mode vlc1 vlc0 < 4.9mhz ckmpu_2x ckmpu_2x sdck sdout sdin e_rxtx/seg48 e_tclk/seg49 e_rst/seg50 flash 32/64/128 kb v3p3a fir eeprom interface ck_4x lcd_gen pb rtc vbias memory share 16 e_rxtx e_tclk e_rst ice_e d s ad converter + - vref v3p3sys test mux vlcd vlcd voltage boost mpu ram 3/5 kb 22 spi vstat vbat_rtc ian ibp ibn va vb* seg pins 2 test mux 2 non-volatile configuration ram bat test temp sensor rtm * 71m6542f/g only figure 1 : ic functional block diagram downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 10 rev 5 1 introduction this data sheet covers the 71m6541d (32kb), 71m6541f (64kb) , 71m6541g (128kb), 71m6542f (64kb) , and 71m6542g (128kb) fourth - generation energy measurement socs . the term 71m654x is used when discussing a device feature or behavior that is applicable to all four part numbers. the appropriate part number is indicated when a device feature or behavior is being discussed that applies only to a specific part number. this data sheet also covers basic details about the companion 71m6x01 iso lated current sensor device. for more complete information on the 71m6x01 sensors, refer to the 71m6xxx data sheet. this document covers the use of the 71m654x with locally connected sensors as well when it is used in conjunction with the 71m6x01 isolated current sensor. the 71m654x and 71m6x01 chipset make it possible to use one non - isolated and one isolated shunt current sensor to create single - phase and two - phase energy meters using inexpensive shunt resistors, while achieving unprecedented performance wi th this type of sensor technology. the 71m654x socs also support configurations involving one l ocally connected shunt and one locally connected current transformer (ct), or two cts . to facilitate document navigation, hyperlinks are often used to reference figures, tables and secti on headings that are located in other parts of the document. all hyperlinks in this document are highlighte d in blue . hyperlinks are used extensively to increase the level of detail and clarity provided within each section by referencing other relevant parts of the document. to further facilitate document nav igation, this document is published as a pdf document with bookmarks enabled. the reader is also encouraged to obtain and review the documents listed in 8 related information on page 164 of this document. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 11 2 hardware description 2.1 hardware overview the 71m6541d/f /g and 71m6542f/g single - chip energy meter ics integrate all primary functional blocks re quired to implement a solid -s tate residential electricity meter. included on the chip are : ? an a nalog front end (afe) featuring a 22 - bit second - order sigma - delta adc ? an independent 32 - bit digital computation engine (ce) to implement dsp functions ? an 8051 - compatible microprocessor (mpu) which executes one instruction per clock cycle (805 15) ? a precision voltage reference (vref) ? a temperature sensor for digital temperature compensation: - metrology digital temperature compensation (mpu) - automatic rtc digital temperature compensation operational in all power states ? lcd drivers ? ram and flash memory ? a real time clock (rtc) ? a variety of i/o pi ns ? a power failure interrupt ? a zero - crossing interrupt ? selectable current sensor interfaces for locally - connected sensors as well as isolated sensors (i.e., using the 71m6x01 companion ic with a shunt resistor sensor) ? resistive shunt and current transformers are supported resistive shunts and current transformers (ct) current sensors are supported . resistive shunt current sensors may be connected directly to the 71m654x device or isolated using a companion 71m6x01 isolator ic in order to implement a variety of single - phase / split - phase (71m6541d/f) or two - phase ( 71m6542f/g ) metering configurations. an inexpensive, small size pulse transformer is used to isol ate the 71m6x01 isolated sensor from the 71m654x. the 71m654x performs digital communications bi - directionally with the 71m6x01 and also provides power to the 71m6x01 through the isolating pulse transformer. isolated (remote) shunt current sensors are connected to the differential input of the 71m6x 01 . included on the 71m6x01 companion isolator chip are: ? digital isolation communications interface ? an a nalog front end (afe) ? a p recision v oltage reference (vref) ? a t emperature sensor (for digital temperature compensation) ? a f ully differential shunt resistor sensor input ? a p re - amplifier to optimize shunt current sensor performance ? isolated power circuitry obtains dc power from pulses sent by the 71m654x in a typical application, the 32 - bit compute engine (ce) of t he 71m654x sequentially processes the samples from the voltage inputs on analog input pins and from the external 71m6x01 isolated sensors and performs calculations to measure active ener gy (wh) and reactive energy (varh), as well as a 2 h, and v 2 h for four - quadrant metering. these measurements are then accessed by the mpu, processed further and output using the peri pheral devices available to the mpu. in addition to advanced measurement functions, the clock function allows the 71 m6541d/f and 71m6542f/g to record time - of - use (tou) metering information for multi - rate applications and to time - stamp tamper or other events. measurements can be displayed on 3.3 v lcds commonly used in low - tem - perature environments . a n on - chip charge pump is available to drive 5 v lcds. flexible mapping of lcd display segments facilitate integration of existing custom lcds. design trade - off between the number of lcd segments and dio pins can be implemented in software to accommodate various re quire ments. in addition to the temperature - trimmed ultra - precision voltage reference, the on - chip digital temperature com pensation mechanism includes a temperature sensor and associated controls for c orrection of unwanted temperature effects on meas ure ment and rtc accuracy, e.g., to meet the requirements of ansi and iec standards . temperature - dependent external components such as crystal oscillator , resistive shunts, current downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 12 rev 5 transformers (cts) and their corresponding signal conditioning circuits can be characterized and their correction factors can be programmed to produce electricity meters with exceptional accuracy ov er the in dus trial temperature range . one of the two internal uarts is adapted to support an infrared led with internal dr ive and sen se configuration and can also function as a standard uart. the optical output can be modulated at 38 khz. this flexibility makes it possible to implement amr meters with an ir interface. a block diagram of the ic is shown in figure 1 . 2.2 analog front end (afe) the afe functions as a data acquisition system, controlled by the mpu. when used with locally connected sensors, a s s een in figure 2 , t he analog input signals ( iap - ian , va and ibp - ibn ) are multiplexed to the adc input and sampled by the adc. the adc output is decimat ed b y the fir filter and stored in ce ram where it can be accessed and processed by the ce. see figure 6 for the multiplexer sequence corresponding to figure 2 . see figure 35 for the meter configuration corresponding to figure 2 . ds adc converter vref mux vref vref vadc 22 fir ibp iap vadc10 (va) ian ibn 71m6541d/f ce ram *in = optional neutral current local shunt in* ct i line or ct 11/5/2010 i line figure 2 . 71m6541d/f /g afe block diagram ( local s ensors ) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 13 figure 3 shows the 71m6541d/f /g multiplexer interface with one local and one remote resistive shunt sensor. as seen in figure 3 , when a remote isolated shunt sensor is connected via the 71m6x01, the samples associated with this current channel are not routed to the multiplexer, and are instead transferred digitally to the 71m654 1d/f /g via the digital isolation interface and are directly stored in ce ram. see figure 6 for the multiplexer timing sequence corresponding to figure 3 . see figure 36 for the meter configurations corresponding to figure 3 . ds adc converter vref mux vref vref vadc 22 fir ibp iap vadc10 (va) ian ibn 71m6541d/f ce ram 71m6x01 sp sn inp inn remote shunt in* digital isolation interface local shunt i line 22 11/5/2010 * in = optional neutral current figure 3 . 71m6541d/f /g afe block diagram with 71m6x01 figure 4 shows the 71m6542f/g afe with locally connected sensors. the analog input signals (iap - ian, va, ibp - ibn and vb) are multiplexed to the adc input and sampled by the adc. the adc output is decimated by the fir filter and stored in ce ram where it can be accessed and processed by the c e. see figure 7 for the multiplexer timing sequence corresponding to figure 4 . see fig ure 37 for the meter configuration corresponding to figure 4 . ds adc converter vref mux vref vref vadc 22 fir ibp iap vadc10 (va) ian ibn 71m6542f ce ram local shunt ib ct ia or ct 11/5/2010 ia vadc9 (vb) figure 4 . 71m6542f/g afe block diagram (local sensors) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 14 rev 5 figure 5 shows the 71m6542f/g multiplexer interface with one local and one remote resistive shunt sensor. as seen in figure 5 , when a remote isolated shunt sensor is connected via the 71m6x01, the samples associated with this current channel are not routed to the multiplexer, and are instead transferred digitally to the 71m6542f/g via the digital isolation interface and are directly stored in ce ram. see figure 6 for the multiplexer timing sequence corresponding to figure 5 . see figure 38 for the meter configurations corresponding to figure 5 . ds adc converter vref mux vref vref vadc 22 fir ibp vadc9 (vb) iap vadc10 (va) ian ibn 71m6542f ce ram 71m6x01 sp sn inp inn remote shunt ib digital isolation interface local shunt ia 22 11/5/2010 figure 5 . 71m6542f/g afe block diagram with 71m6x01 2.2.1 signal input pins the 71m6541d/f /g features five adc inputs. the 71m6542f/g features six adc input s. iap - ian and i bp - ibn are intended for use as current sensor inputs. these four current sensor inputs can be configured as two single - ended inputs, or can be paired to form two differential inputs. for best performance, it is recommended to configure the current sensor inputs as differentia l inputs (i.e., iap - ian and ibp - ibn ). the first differential input ( iap - ian ) features a pre - amplifier with a selectable gain of 1 or 8, and is intended for direct connection to a shunt resistor sensor, and can also be used with a current transformer (ct). the remaining differential pair (i.e., ibp - ibn ) may be used with cts, or may be enabled to interface to a remote 71m6x01 isolated current sensor providing isolation for a shunt resistor sensor using a low cost pulse transformer. the remaining input in the 71m6541d/f ( va ) is single - ended, and is intended for sensing the line voltage in a single -p hase meter application using equation 0 or 1 (see 2.3.4 meter equations on page 25 ) . the 71m6542f/g features an additional single - ended voltage sensing input ( vb ) to support bi - phase applications using equation 2. these single - ended inputs are referenced to the v3p3a pin. all analog signal input pins measure voltage . in the case of shunt current sensors, currents are sensed as a voltage drop in the shunt resistor sensor . referring to figure 3 , s hunt sensors can be connected directly to the 71m654x (referred to as a local shunt sensor) or connected via an isolated 71m6x01 (referred to as a remote s hunt sensor). in the case of current transformer s (ct), the current is measured as a voltage across a burden resistor that is connected to the secondary winding of the ct. mean while , line voltages are sens ed through resistive voltage divider s. the va and vb pins ( vb is available in the 71m6542f/g only) are sin gle - ended and their common return is the v3p3a pin . pins iap - ian can be programmed individually to be differential or single - ended as determined by the diffa _e ( i/o ram 0x210c[4] ) control bit . however, for most applications , iap - ian are configured as a differential input to work with a shunt or ct directly interfaced to the iap - ian differential input with the appropriate external signal conditioning components (see 4.2 direct connection of sensors on page 92 ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 15 the performance of the iap - ian pins can be enhanced by enabling a pre - amplifier with a fixed gain of 8, using the i/o ram control bit pre_e (i/o ram 0x2704[5]) . when pre_e = 1, iap - ian become the inputs to the 8x pre - amplifier, and the output of this amplifier is supplied to the multiplexer. the 8x amplific ation is useful when current sensors with low sensitivity, such as shunt resistors, are us ed. with pre_e set, the iap - ian input signal amplitude is restricted to 31.25 mv peak. f or the 71m654x application utilizing two shunt resistor sensor s ( figure 3 ), the iap - ian pins are configured for differential mode to interface to a local shunt by setting the diffa _e control bit. meanwhile, t he ibp - ibn pins are re - configured as digital balanced pai r to communicate wi th a 71m6x01 isolated sensor interface by setting the rmt_e control bit ( i/o ram 0x2709[3] ). the 71m6x01 communicates with the 71m654x using a bi - directional digital data stream through an isolating low - cost pulse transformer . the 71m65 4x also supplies power to the 71m6x01 through the isolating transformer. this type of interface is further described at the end of this chapter (see 2.2.8 71m6x01 isolated sensor interface (remote sensor interface) ). for use with current transformers (cts), as shown in figure 2 , the rmt_e control bit is reset, so that the ibp - ibn pins are configured as local analog inputs. the iap - ian pi ns cannot be configured as a remote sensor interface. 2.2.2 input multiplexer when operating with local sensors, t he input multiplexer sequentially applies the input signals from the analog input pins to the input of the adc (see figure 2 and figure 4 ). one complete samplin g sequence is called a multiplexer frame. the multiplexer of the 71m6541d/f can select up to three input signal s ( iap - ian , va , and ibp - ibn ) per multiplexer frame as controlled by the i/o ram control field mux_div [3:0] (i/o ram 0x2100[7:4]) (see figure 6 ) . the multiplexer of the 71m6542f/g adds the vb signal to achieve a total of four inputs (see figure 7 ) . the multiplexer always starts at state 1 and proceeds until as many states as determined by mux_div [3:0] have been converted. the 71m6541d/f /g and 71m6542f/g each require a unique ce code that is written for the specific application. moreover, each ce code requires specific afe and mux settings in order to function properly . table 1 provides the ce code and settings corresponding to the local sensor configurations shown in figure 2 and figure 4 . table 2 provides the ce code and settings corresponding to the local/remote sensor configuration utilizing the 71m6x01 as shown in figure 3 and figure 5 . table 1 . required ce code and settings for local sensors i/o ram mnemonic i/o ram location 71m6541d/ f/g (hex) 71m6542f/g (hex) eq. 0 or 1 eq. 2 fir_len[1:0] 210c[2:1] 1 1 2 adc_div 2200[5] 1 1 0 pll_fast 2200[4] 1 1 1 mux_div[3:0] 1 2100[7:4] 3 3 4 mux0_sel[3:0] 2105[3:0] 0 0 0 mux1_sel[3:0] 2105[7:4] a a a mux2_sel[3:0] 2104[3:0] 2 2 2 mux3_sel[3:0] 2104[7:4] 1 1 9 rmt_e 2709[3] 0 0 0 diffa_e 210c[4] 1 1 1 diffb_e 210c[5] 1 1 1 equ[2:0] 2106[7:5] 0 or 1 0 or 1 2 ce code -- ce41a01 ce41a01 ce41a04 equations -- 0 or 1 0 or 1 2 current sensor types -- 1 shunt and 1 ct or 2 cts 1 shunt and 1 ct or 2 cts 1 shunt and 1 ct or 2 cts applicable figure -- figure 2 figure 4 figure 4 note s: 1 . mux_div[3:0] must be set to 0 while writing the other ram locations in this table. maxim updates the ce code periodically . c ontact your local maxim representative to obtain the latest ce code and the associated settings. the configuration presented in this table is set by the mpu demonstration code during initialization. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 16 rev 5 table 2 . required ce code and settings for 71m6x01 i solated sensor i/o ram mnemonic i/o ram location 71m6541d/ f/g (hex) 71m6542f/g (hex) fir_len[1:0] 210c[2:1] 1 1 adc_div 2200[5] 1 1 pll_fast 2200[4] 1 1 mux_div[3:0] 4 2100[7:4] 3 3 mux0_sel [3:0] 2105[3:0] 0 0 mux1_sel [3:0] 2105[7:4] a a mux2_sel [3:0] 1 2104[3:0] 1 9 mux3_sel [3:0] 1 2104[7:4] 1 1 rmt_e 2709[3] 1 1 diffa _e 210c[4] 1 1 diffb_e 210c[5] 0 0 equ[2:0] 2106[7:5] 0 or 1 0, 1 or 2 ce code -- ce41b016201 2 ce41b016601 3 equations -- 0, 1 0, 1 and 2 current sensor type -- 1 local shunt and 1 remote shunt 1 local shunt and 1 remote shunt applicable figure -- figure 3 figure 5 note s: 1. although not used, set to 1 (the sample data is ignored by the ce) 2. 71m654 x with 71m6201 remote sensor (200 a mps ) 3. 71m654 x with 71m6601 remote sensor (60 a mps ) 4. mux_div[3:0] must be set to 0 while writing the other ram locations in this table. maxim updates the ce code periodically . c ontact your local maxim representative to obtain the latest ce code and the associated settings. the configuration presented in this table is set by the mpu demonstration code during initialization. using s ettings for the i/o ram mnemonics listed in table 1 and table 2 that do not match those required by the corresponding ce code being used results in undesirable side effects and must not be selected by the mpu . consult your local maxim representative to obtain the correct ce code and afe / mux settings corresponding to the application . for a ba sic single - phase app lication, the iap - ian current input is configured for differential mode, whereas the va pin is single - ended and is typically connected to the phase voltage via a resistor divider. the ibp - ibn differential input may be optionally used to sense the neutral current. this configuration implies that the multiplexer applies a total of three inputs to the adc. for this configuration, the multiplexer sequence is as shown in figure 6 . i n this configuration iap - ian , ibp - ibn and va are sampled, the extra conversion time slot (i.e., slot 2) is the optional neutral current, and the physical current sensor for the neutral current measurement may be omitted if not required. for a standard single - phase application with tamper sensor in the neutral path, two current inputs ca n b e configured for differential mode, using the pin pairs iap - ian and ibp - ibn . this means that the multi plexer ap plies a total of thr ee inputs to the adc. in th is application, the system design may use two locally connected current sensors via iap - ian and ibp - ibn , as shown in figure 2 , and configured as differential inputs. alternately , t he iap - ian pin pair is configured as a differential input and connected to a local current shunt , and ibp - ibn is configured to connect to an isolated 71m6x01 isolated sensor (i.e., rmt_e = 1) , as shown in figure 3 . the va pin is typically connected to the ph ase voltag e via resistor dividers. for this configuration, the multiplexer frame is also as shown in figure 6 and time slot 2 is unused and ignored by the ce, as the samples corresponding to the remote sensor (ibp - ibn) do not pass through the multiplexer and are stored directly in ce ram. the remote current sensor channel is sampled during the secon d half of the multiplexer frame and its timing relationship to the va voltage is precisel y known so that delay compensation can be properly applied. the 71m6542f adds the ability to sample a second phase vo ltage (applied at the vb pin ) , which makes it suitable for meters with two voltage and two current sensors, such as meters implementing equation 2 for dual - phase operation (p = va*ia+vb*ib) . figure 7 shows the multiplexer sequence when four inputs are downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 17 processed with locally connected sensors, as shown in figure 3 . when using one local and one remote sensor ( figure 5 ), the multiplexer sequence is also as shown in figure 7 . for both multiplexer sequences shown in figure 6 and figure 7 , the frame duration is 13 ck32 cycles (where ck32 = 32768 hz), therefore, the resulting sample rate is 32768 hz / 13 = 2520.6 hz. table 3 summarizes the various afe input configu ra tions. ck32 mux state 00 1 2 mux_div[3:0] = 3 conversions settle multiplexer frame s cross mux_sync 0 s 11/5/2010 fig. 2: ia va ibfig. 3: ia va not used fig. 5: ia va vb figure 6 : states in a multiplexer frame ( mux_div [3:0] = 3) ck32 mux state 0 1 2 3 mux_div = 4 conversions settle multiplexer frame s cross mux_sync 0 s 11/5/2010 fig. 4: ia va ib vb figure 7 : states in a multiplexer frame ( mux_div [3:0] = 4) table 3: adc input configuration pin adc channel required setting comment iap adc0 diffa _e = 1 d ifferential mode must be selected with diffa _e = 1 ( i/o ram 0x210c[4] ) . t he adc results are stored in ce ram location adc0 ( ce ram 0x0 ) , and adc1 ( ce ram 0x1 ) is not disturbed. ia n adc1 i bp adc2 diffb _e = 1 or rmt_e = 1 for locally connected sensors ( figure 2 and figure 4 ), the differential input must be enabled by setting diffb _e (i/o ram 0x21 0c[5] . for the remote connected senso r ( figure 3 and figure 5 ) with a remote shunt sensor , rmt_e ( i/o ram 0x2709[ 3] ) must be set . in both cases, t he adc results are stored in ram location adc2 (ce ram 0x2) , and adc3 (ce ram 0x3) is not disturbed. i bn adc3 va adc10 -- single - ended mode only. the adc result is stored in ram location adc10 ( ce ram 0xa ). vb adc 9 -- single - ended mode only (71m6542f only). the adc result is stored in ram location adc 9 ( ce ram 0x 9 ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 18 rev 5 mult iplexer advance, fir initiation and chopping of the adc reference voltage (using the internal cross signal, see 2.2.7 voltage references ) are controlled by the inter nal mux_ctrl circuit . additionally, mux_ctrl launches each pass of the ce through it s code . con ceptually, mux_ctrl is clocked by ck32, the 32768 hz clock from the pll block. the behavior of the mux_ctrl circuit is governed by : ? chop_e [1:0] ( i/o ram 0x2106[3:2] ) ? mux_div [3:0] ( i/o ram 0x2100[7:4] ) ? fir_len [1:0] ( i/o ram 0x210c[ 2:1 ] ) ? adc_div ( i/o ram 0x2200[5] ) the duration of each multiplexer state depends on the number of adc samples processed by the fir as determined by the fir_len [1:0] (i/o ram 0x210c[2:1] control field . each multiplexer state start s on the rising edge of ck32, the 32 - khz clock. it is required that mux_div [3:0] (i/o ram 0x2 1 00[ 7:4 ]) be set to zero while changing the adc configuration to minimize system transients . after all configuration bits are set, mux_div [3:0] should be set to the required value. additionally, the adc can be configured to operate at one - half rate (32768*75=2.46mhz). in this mode, the bias current to the adc amplifiers is reduced and overall system power is reduced. the adc_div (i/o ram 0x2200[5]) bit selects full speed or half speed. at half speed, if fir_len [1:0] is set to 01 (288) , e ac h conversion require s 4 xtal cycles, resulting in a 2520hz sample rate when mux_div [3:0] = 3. note that i n order to work with these power - reducing settings, a corresponding ce code is required. the duration of each time slot in ck32 cycles depends on fir_ len [1:0] , adc_div and pll_fast : time_slot_duration ( pll_fast = 1) = ( fir_len [1:0] +1 ) * ( adc_div +1) time_slot_duration ( pll_fast = 0) = 3* ( fir_len [1:0] +1 ) * ( adc_div +1) th e duration of a multiplexer frame in ck32 cycles is: mux_frame_d uration = 3- 2* pll_fast + time_slot_duration * mux_div [3:0] the duration of a multiplexer frame i n ck_fir cycles is: mux frame duration (ck_fir cycles) = [3 - 2* pll_fast + time_slot_duration * mux_div ] * (48+ pll_fast *102) the adc conversion sequence is programmable through the muxx_sel control fields ( i/o ram 0x210 0 to 0x2105 ) . as stated above, there are three adc time slots in the 71m6541d/f /g and four adc time slots in the 71m6542f/g , as set by mux_div [3:0] ( i/o ram 0x210 0[7:4] ) . in the expression muxx_sel [3:0] = n, x refers to the multiplexer frame time slot number and n refers to the desired adc input number or adc handle (i.e., adc0 to adc10, or simply 0 to 10 decimal) . thus, there are a total of 11 valid ad c handles in the 71m654x devices. for example, if mux 0 _sel [3:0] = 0 , then adc 0 , corresponding to the sample from the iap - ian input (configured as a differential input) , is positioned in the multiplexer frame during time slot 0 . see table 1 and table 2 for the appropriate muxx_ sel[3:0] settings and other settings applicable to a particular ce code. note that when the remote sensor interface is enabled, and even though the samples corresponding to the remote sensor current ( ibp - ibn ) do not pass through the multiplexer, the mux2_s el[3:0] and mux3_sel[3:0] control fields must be written with a valid adc handle that is not being used . t ypically , adc 1 is used for this purpose (see table 2 ). in this manner, the adc 1 handle, which is not used in the 71m6541d/f /g or 71m6542f/g , is used as a place holder in the multiplexer frame, in order to generate the correct multiplexer frame sequence and the correct sample rate. the resulting sample data stored in ce ram 0x 1 is undefined and is ignored by the ce code. meanwhile, the digital isolation interface takes care of automatically storing the samples for the remote interface current ( ib p- ibn ) in ce ram 0x2 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 19 delay compensation and other functions in the ce code require the settings for m ux_div [3:0] , m uxx_sel [3:0] , rmt _e, fir_len [1:0] , adc_div and pll_fast to be fixed for a given ce code. refer to table 1 and table 2 for the settings that are applicable to the 71m6541d/f /g and 71m6542f/g . table 4 summarizes the i/o ram registers used for configuring the multiplexer, signals pins, and adc. all listed registers are 0 after reset and wake from battery modes, and are re a dable and writabl e. table 4: multiplexer and adc configuration bits name location description mux0_sel[3:0] 2105[3:0] selects the adc input converted during time slot 0. mux1_sel[3:0] 2105[7:4] selects the adc input converted during time slot 1 . mux2_sel[3:0] 2104[3:0] selects the adc input converted during time slot 2 . mux3_sel[3:0] 2104[7:4] selects the adc input converted during time slot 3 . mux4_sel[3:0] 2103[3:0] selects the adc input converted during time slot 4 . mux5_sel[3:0] 2103[7:4] selects the adc input converted during time slot 5 . mux6_sel[3:0] 2102[3:0] selects the adc input converted during time slot 6 . mux7_sel[3:0] 2102[ 7 :0] selects the adc input converted during time slot 7 . mux8_sel[3:0] 2101[3:0] selects the adc input converted during time slot 8 . mux9_sel[3:0] 2101[ 7 :0] selects the adc input converted during time slot 9 . mux10_sel[3:0] 2100[3:0] selects the adc input converted during time slot 1 0. adc_div 2200[5] controls the rate of the adc and fir clocks. mux_div[3:0] 2100[7:4] the number of adc time slots in each multiplexer frame (maximum = 11). pll_fast 2200[4] controls the speed of the pll and mck. fir_len[1:0] 210c[1] determines t he number of adc cycles in the adc decimation fir filter. diffa _e 210c[4 ] enables the differential configuration for analog input pins iap - ian . diffb _e 210c[5 ] enables the differential configuration for analog input pins ibp - ibn . rmt_e 2709[3] enables the remote sensor interface transforming pins ibp - ibn into a digital balanced differential pair for communications with the 71m6x01 sensor. pre_e 2704[5] enables the 8x pre - amp lifier. refer to table 76 starting on page 111 for more complete details about these i/o ram locations. 2.2.3 delay compensation when measuring the energy of a phase (i.e., wh and varh) in a service, the voltage and current for that phase must be sampled at the same instant. otherwise, the phase difference, , introduces errors. o delay o delay f t t t 360 360 ? ? = ? = f where f is the frequency of the input signal , t = 1/f and t delay is the sampling delay between current and voltage. tradition ally, sampling is accomplished by using two a/d converters per phase (one for voltage and t he other one for current) controlled to sample simultaneously. maxims single - converter technology, however, ex ploits the 32 - bit signal processing capability of its ce to implement constant delay all - pass filters. the all - pass filter corrects for the conversion time difference between the voltage and the correspond ing current samples that are obtained with a single multiplexed a/d converter. the constant delay all - pass filter provides a broad - band delay 360 o C , which is precisely matched to the difference in sample time between the voltage and the current of a given phase. this digital filter does not affect the amplitude of the signal, but provides a precisely controlled phase response. the recommended adc multiplexer sequence samples the current first, immediately followed by sampling of the corresponding phase voltage, thus the voltage is delayed by a phase angle relative to downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 20 rev 5 the current. the delay compensation implemented in the ce aligns the voltage samples with their corresponding current samples by first delaying the current samples by one full sample in terval (i.e., 360 o ), then routing the voltage samples through the all - pass filter, thus delaying the voltage samples by 360 o - , resulting in the residual phase error between the current and its corresponding voltage of C . the residual phase error is negligible, and is typically less than 1.5 milli - degrees at 100hz, thus it does not contribute to errors in the energy measurements. when using remote sensors, the ce performs the same delay compensation described above to align each voltage sample with its corresponding current sample. even though the remote current samples do not pass through the 71m654 x multiplexer, their timing relationship to their corresponding voltages is fixed and precisely known, provided that the muxn_sel[3:0] slot assignment fields are programmed as shown in table 1 and table 2 . 2.2.4 adc pre -a mp lifier the adc pre - amp lifier is a low - noise differential a mpl ifier with a fixed gain of 8 available only on the iap - ian sensor input pins . a gain of 8 is enabled by setting pre_e = 1 ( i/o ram 0x2704[5] ) . when disabled, the supply current of the pre - amplifier is <10 na and the gain is unity. with proper settings of the pre_e and diffa _e ( i/o ram 0x210c[4] ) bits, the pre - amplifier can be used whether diffe rential mode is selected or not. for best performance, the differential mode is recommended. in order to save power, the bias current of the pre - amplifier and adc is adjusted according to the adc_div control bit ( i/o ram 0x2 200 [5] ). 2.2.5 a/d converter (adc) a single 2 nd order delta - sigma a/d converter digitizes the voltage and current inputs to the device . the resolution of the adc, including the sign bit , is 21 bits ( fir_len [1:0] = 1 , i/o ram 0x210c[ 2: 1] ), or 22 bits ( fir_len [1:0] = 2 ). the adc is clocked by ckadc. initiation of each adc conversion is controlled by mux_ctrl internal circuit as described above. at the end of each adc conversion, the fir filter output data is stored into the ce ram location determined by the multiplexer selection. fir data is stored lsb justified, but shifted left 9 bits. 2.2.6 fir filter the finite impulse response filter is an integral part of the adc and it is optimized for use wi th the multiplexer. the purpose of the fir filter is to decimate the adc output to the desired resolution. at the end of each adc conversion, the output data is stored into the fixed ce ram location determined by the mul tiplexer selection as shown in table 1 and table 2 . 2.2.7 voltage references a bandgap circuit provides the reference voltage to the adc. the amplifier wit hin the reference is chopper stabilized, i.e. , the chopper circuit can be enabled or disabled by the mpu using the i/o ram control field chop_e [1:0] (i/o ram 0x2106[3:2]) . the two bits in the chop_e [1:0] field enable the mpu to operate the chopper circuit in regular or inverted operation, or in toggling modes (recommended) . when the chopper circuit is toggled in between mul tiplexer cycles, dc offsets on vref are automatically be averaged out, therefore the chopper circuit should always be configured for one of the toggling modes. since the vref band - gap amplifier is chopper - stabilized, the dc offset voltage, which is the most significant long - term drift mechanism in the voltage references (vref), is automatically removed by the chopper circuit. both the 71m654 x and the 71m6x 01 feature chopper circuits for their respective vref voltage reference. the general topology of a chopped amplifier is shown in figu re 8 . the cross signal is an internal on - chip signal and is not accessible on any pin or register. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 21 figu re 8 : general topology of a chopped amplifier it is assumed that an offset voltage voff appears at the positive amplifier input. with all switches, as controlled by cross (an internal signal), in the a position, the output voltage is: voutp C voutn = g (vinp + voff C vinn) = g (vinp C vinn) + g voff with all switches set to the b position by applying the inverted cross signal, the output voltage is: voutn C voutp = g (vinn C vinp + voff) = g (vinn C vinp) + g voff, or voutp C voutn = g (vinp C vinn) - g voff thus, when cross is toggled, e.g., after each multiplexer cycle, the offset alternately appear s on the output as positive and negative, which results in the offset effectively being eliminat ed, regardless of its polarity or magnitude. when cross is high, the connection of the amplifier input devices is reversed. this preserves the overall polarity of that amplifier gain; it inverts its input offset. by alternately reversing the connection, the amplifiers offset is averaged to zero. this removes the most significant long - term drift mecha nism in the voltage reference. the chop_e [1:0] ( i/o ram 0x2 106 [3:2] ) control field control s the behavior of cross. the cross signal reverse s the amplifier connection in the voltage reference in order to negate the effects of its offset. on the first ck32 rising edge after the last multiplexer state of its sequence, the multiplexer wait s one additional ck32 cycle before beginning a new frame. at the beginning of this cycle, the value of cross is updated according to the chop_e [1:0] field . the extra ck32 cycle allows time for the chopped vref to settle. during this cycle, muxsync is held high. the leading edge of muxsync initiates a pass through the ce program sequence . the beginning of the sequence is the serial readout of the four rtm words. chop_ e [1:0] has four states: positive, reverse, and two toggle states. in the positive state, chop_e [1:0] = 01, cross is held low. in the reverse state, chop_e [1:0] = 10, cross is held high. figure 9 : cross signal with chop_e = 0 0 figure 9 shows cross over two accumulation interval s when chop_e [1:0] = 00: at the end of the first in ter val, cross is high, at the end of the second interval, cross is low . operation with chop_e [1 :0] = 00 does not require control of the chopping mechanism by the mpu . in the second toggle state, chop_e [1:0] = 11, cross does not toggle at the end of the last multiplexer cycle in an accumulation interval . a second, low - power voltage reference is used in the lcd system and for the comparators that support transitions to and from the battery modes. g - + v inp v outp v outn v inn cross ab ab a b a b downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 22 rev 5 2.2.8 71m6x01 isolated sensor interface (remote sensor interface) 2.2.8.1 general description non - isolating sensors, such as shunt resistors, can be connected to the inputs of the 71m654 x via a combination of a pulse transformer and a 71m6x01 ic (a top - level block diagram of this sensor interface is shown in figure 36 ) . the 71m6x01 receives power directly from the 71m654x via a pulse transformer and does not require a dedicated power supply circu it. the 71m6x01 establishes 2 - way communication with the 71m654x , supplying current samples and auxiliary information such as sensor temperature via a serial data stream. one 71m6x01 isolated sen sor can be supported by the 71m6541 d/f/g and 71m6542f/g . when remote in terface ibp - ibn is en abled, the two analog current i nputs pins i bp and i bn become a digital balanced differential interfac e to the remote sensor. see table 3 for details. each 71m6x01 isolated sensor consists of the following building blocks: ? power supply for power pulses received from the 71m654x ? digital c ommunication s interface ? shunt signal p re - amplifier ? delta - sigma adc converter with precision bandgap reference (chopping amplifier) ? temperature sensor ? fuse system containing part - specific information during an ordinary mu ltiple x er cycle, the 71m654 x internally determines which other channels are enabled with mux_div[3:0] (i/o ram 0x2100[7:4]) . at the same time, it decimate s the modulator output from the 71m6x01 isolated s ensors. each result is written to ce ram during one of its ce access time slots. see table 3 for the ce ram location s of the sampled signals. 2.2.8.2 communication between 71m654 x and 71m6x01 isolated sensor the adc of the 71m6x01 derives its timing from the power pulses generated by the 71m654x and as a result, operates its adc slaved to the frequency of the power pulses. the generation of power pulses, as well as the communication protocol between the 71m654x and 71m6x01 isolated sensor is au tomatic and transparent to the user. details are not covered in this data sheet. 2.2.8.3 control of the 71m6x01 isolated sensor the 71m654 x can read or write certain types of information from each 71m6x01 isolated sensor. the data to be read is selected by a c ombination of the rcmd[4:0] and tmuxrn[2:0] . to perform a read transaction from one of the 71m6x01 devices, the mpu first writes the tmuxrn [2:0 ] field (where n = 2, 4, 6, located at i/o ram 0x270a[2:0] , 0x270a[ 6:4] and 0x270 9 [2:0] , respectively ) . next, the mpu writes rcmd[4:0 ] ( sfr 0xfc[4:0] ) with the desired command and phase selection . when the rcmd[4:2] bits have cleared to zero, the transaction has been completed and the requested data is available in rmt _rd[15: 0] ( i/o ram 0x2602[7:0] is the msb and 0 x2603[7:0] is the lsb) . the read parity error bit, perr _r d (sfr 0xfc[6]) is also updated during the transaction. if the mpu writes to rcmd[4:0] before a previously initiated read transaction is completed , the command is ig nored. therefore, the mpu must wait for rcmd[4:2] =0 before proceeding to issue the next remote sensor read command. the rcmd[4:0] field is divided into two sub - fields, command =rcmd[4:2] and phase=rcmd[1:0] , as shown in table 5 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 23 table 5 . rcmd[4:0] bits command rcmd[4:2] phase selector rcmd[1:0] associated tmuxrn control field 000 invalid 00 invalid --- 001 command 1 01 ibp - ibn tmuxr b [2:0] 010 command 2 011 reserved 100 reserved 101 invalid 110 reserved 111 reserved notes: 1. only two codes of rcmd[4:2 ] ( sfr 0x fc[4:2] ) are relevant for normal operation. these are rcmd[4:2 ] = 001 and 010. codes 000 and 101 are invalid and will be ignored if used. the remaining codes are reserved and must not be used. 2. for the rcmd [1 :0 ] control field, codes 01, 10 and 11 are valid and 00 is invalid and must not be used. table 6 shows the allowable combinations of values in rcmd[4:2 ] a nd tmuxrn[2:0 ] , and the corresponding data type and format sent back by the 71m6x01 isolated sensor and how the data is stored in rmt_rd[15:8] and rmt_rd[7:0] . the mpu selects which of the three phases is read by asserting the proper code in the rcmd[1:0] field, as shown in table 5 . table 6: remote interface read commands rcmd[4:2] tmuxrn[2:0] read operation rmt_rd [15:8] rmt_rd [7:0] 001 00x trimt[7:0] ( trim fuse for all 71m6x01 ) trimt[7]=rmt_rd[8] trimt[6:0]=rmt_rd[7:1] 010 00x stemp[10:0] (sensed 71m 6x01 temperature) stemp[10:8]=rmt_rd[ 10 :8] (rmt_rd[15: 11 ] are sign extended) stemp[7:0] 010 01x vsense[ 7 :0] (sensed 71m 6x01 supply voltage) all zeros vsense[7:0] 010 10x version[7:0] (chip version) version [7 :0] all zeros notes: 1. trimt[7:0] is the vref trim value for all 71m6x01 devices. note that the trimt[7:0] 8- bit value is formed by rmt_rd[8] and rmt_rd[7:1]. see the 71m6xxx data sheet for more information on trimt[7:0] 2. see the 71m6xxx data sheet for the equation to calculate temperature from the stemp[7:0] value read from the 71m6x01. 3. see the 71m6xxx data sheet for the equation to calculate temperature from the vsense[7:0] value read from the 71m6x01. with hardware and trim - related information on each connected 71m6x01 isolated sensor available to the 71m6541d/f /g , the mpu can implement temperature compensation of the energy measurement based on the individual temperature characteristics of the 71m6x01 isolated sensor. see 4.7 metrology temperature compensation on page 97 for details. table 7 shows all i/o ram registers used for control of the external 71m6x01 isolated sensors. see the 71m6xxx data sheet for additional details. table 7: i/o ram control bits for isolated sensor name addr ess rst default wake default r/w description rcmd[4:0] sfr fc[4:0] 0 0 r/w when the mpu writes a non - zero value to rcmd , the 71m654 x issue s a command to the cor - responding isolated sensor selected with rcmd[1:0] . when the command is complete, the 71m654 x clears rcmd[4:2]. the command code downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 24 rev 5 name addr ess rst default wake default r/w description itself is in rcmd[4:2 ]. perr_rd perr_wr sfr fc[6] sfr fc[5] 0 0 r/w the 71m654 x sets these bits to indicate that a parity error on the isolated sensor has been de - tected. once set, the bits are re mem bered until they are cleared by the mpu. chopr[1:0] 2709[7:6] 00 00 r/w the chop settings for the is o la te d sensors. 00 C auto chop. change every multiplexer frame. 01 C positive 10 C negative 11 C same as 00 tmuxr b [2:0] 270 a [2:0] 000 000 r/w the tmux bits for control of the isolated sensor. rmt _rd[15:8] rmt _rd[7:0] 2602[7:0] 2603[7:0] 0 0 r the read buffer for 71m6x01 read operation s. rfly_dis 210c[3] 0 0 r/w controls how the 71m654 x drives the 71m6x01 power pulse. when set, the power pulse is driven high and low. when cleared, it is driven high followed by an open circuit flyback interval . rmt _e 2709[3] 0 0 r/w enables the isolated remote sensor interface and re - configures pins ibp - ibn as a balanced pair digital remote interface. refer to table 76 starting on page 111 for more complete details about these i/o ram locations. 2.3 digital computation engine (ce) the ce, a dedicated 32 - bit signal processor, performs the precision computations necessary to accuratel y measure energy. the ce calculations and processes include: ? multiplication of each current sample with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time). ? frequency - insensitive delay cancellation on all four channels (to compensate for the delay bet ween samples caused by the multiplexing scheme). ? 90 phase shifter (for var calculat ions). ? pulse generation. ? monitoring of the input signal frequency (for frequency and phase information). ? monitoring of the input signal amplitude (for sag detection). ? scaling of the processed samples based on calibration coefficients. ? scaling of samples based on temperature compensation information. 2.3.1 c e program memory the ce program resides in flash memory. common access to flash memory by the ce and mpu is controlled by a memory share circuit. each ce instruction word is two bytes long. allocat ed flash space for the ce program cannot exceed 4096 16 - bit words (8 kb). the ce program counter begins a pass through the ce code each time multiplexer state 0 begins. the code pass ends when a halt instruction is exec uted. for proper operation, the code pass must be completed before the multiplexer cycle ends . the ce program must begin on a 1 kb boundary of the flash address. the i/o ram control field ce_lctn[ 5 :0] ( i/o ram 0x2109[5: 0] ) defines which 1 kb boundary contains the ce code. thus, th e first ce instruction is lo cated at 1024* ce_lctn[5 :0]. 2.3.2 ce data memory the ce and mpu share data memory (ram). common access to xram by the ce and mpu is controlled by a memory share circuit. the ce can access up to 3 kb of the 3 kb data ram (xram) , i.e., from ram address 0x0000 to 0x0c00 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 25 the xram can be accessed by the fir filter block, the rtm circuit, the c e, and the mpu. assigned time slots are reserved for fir and mpu, respectively, to prevent bus contention for xram data access by the ce . the mpu read s and write s the xram shared between the ce and mpu as the primary means of data communication between the two processors. table 3 shows the ce addresses in xram allocated to analog inputs from the afe. the ce is aided by support hardware to facilitate implementation of equations, pulse counters, and ac cumulators. this hardware is controlled through the i/o ram control field equ [2:0 ], equation assist ( i/o ram 0x2106[7:5] ), bit dio_pv (i/o ram 0x2457[6]) , bit dio_pw , pulse count assist ( i/o ram 0x2457[7] ) , and sum _samp s [12:0] , accumulation assist ( i/o ram 0x2107[4:0] and 0x2108[7:0] ). sum_samp s [12:0] support s an accumulation scheme where the incremental energy values f rom up to sum_samps [12:0] multiplexer frames are added up over one accumulation interval . the integration time for each energy output is, for example, sum_samps [12:0] /2520.6 (with mux_div[3:0] = 011 , i/o ram 0x2100[7:4] and fir_len [1:0] = 10 , i/o ram 0x210c[ 2: 1] ). ce hardware issues the xfer_busy interrupt when the accumulation is complete. 2.3.3 ce communication with the mpu the ce outputs six signals to the mpu: ce_busy, xfer_busy, xpulse, ypulse , wpulse and vpulse . these are connected to the mpu interrupt service. ce_busy indicates that the ce is ac tively processing data. this signal occur s once every multiplexer frame. xfer_busy indicat es that the ce is updating to the out put region of the ce ram, which occur s whenever an accumulation cycle has been completed. both, ce_busy and xfer_busy are cleared when the ce executes a halt instruction. xpulse , ypulse , vpulse , and wpulse can be configured to interrupt the mpu and indicate zero crossings of the mains voltage, sag failures , or other significant events. additionally, these signals can be connected directly to dio pins to provide direct outputs for the ce. interrupts associated with th ese signals a lways occur on the leading edge (see external interrupt source no. 2 in figure 16 ). 2.3.4 meter equations the 71m6541d/f /g and 71m6542f/g provide hardware assistance to the ce in order to support various meter equations. this assistance is controlled through i/o ram register eq u [2:0] (equation assist). the compute engine (ce) firmware for industrial configurations can implement the equations listed in table 8 . equ [2:0] specifies the equation to be used based on the meter configuration and on the number of phases used for metering. table 8 : inputs selected in multiplexer cy cles equ description wh and varh formula recommended multiplexer se quence element 0 element 1 element 2 0 1- element, 2 - w, 1 f with neutral current sense va ia va ib 1 n/a ia va ib 1 1 1- element, 3 - w, 1 f va(ia - ib)/2 n/a n/a ia va ib 2 ? 2- element, 3- w, 3 f delta va ia vb ib n/a ia va ib vb note: 1. optionally, ib may be used to measure neutral current ? 71m6542f/g only 2.3.5 real - time monitor (rtm) the ce contains a real - time monitor (rtm), which can be programmed to monitor four selectable xram locations at full sample rate. the four monitored locations, as selected by the i/o ram reg isters rtm0[9:8], rtm0[7:0], rtm1[9:8], rtm1[7:0], rtm2[9:8], rtm2[ 7:0], rtm3[9:8], and rtm3[7:0] , are serially output to the tmuxout pin via the digital output multiplexer at the beginning of each ce code pass. the rtm can be enabled and disabled with control bit rtm_e (i/o ram 0x2106[1]) . the rtm out put is clocked by cktest. each rtm word is clocked out in 35 ckce cycles (1 ckce cycle is downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 26 rev 5 equivalent to 203 ns) an d contains a leading flag bit. see figure 10 for the rtm output format. rtm is low when not in use. figure 11 summarizes the timing relationships between the input mux states, the ce_busy signal , and the rtm serial output stream. in this example, mux_div [3:0] = 4 (i/o ram 0x2100[7:4]) and fir_len [1:0] = 10 (i/o ram 0x210c[ 1]) , (384), resulting in 4 adc conversions. an adc conversi on always consume s an integer number of ck32 clocks. followed by the conversions is a single ck32 cycle . figure 11 also shows that the rtm serial data stream begins transmitting at the beginning of state s. rtm, consisting of 140 ck cycles, always finish es before the next ce code pass starts. figure 10 : rtm timing ck32 mux state 0 mux_div conversions, mux_div =4 is shown settle adc mux frame adc execution s mux_sync s ce_execution rtm 140 max ck count 0 450 150 900 1350 1800 adc0 adc1 adc2 adc3 ck count = ce_cycles + 1ck for each adc transfer notes: 1. all dimensions are 5mhz ck counts. 2. the precise frequency of ck is 150*crystal frequency = 4.9152mhz. 3. xfer_busy occurs once every sum_samps code passes. ce_busy xfer_busy initiated by a ce opcode at end of sum interval adc timing ce timing rtm timing 1 2 3 figure 11 : timing relationship be tween adc mux, ce, and rtm serial transfer cktest rtm flag rtm data0 (32 bits) lsb sign lsb sign rtm data1 (32 bits) lsb lsb sign sign rtm data2 (32 bits) rtm data3 (32 bits) 0 1 30 31 0 1 30 31 0 1 30 31 0 1 30 31 flag flag flag mux_state s mux_sync ck32 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 27 2.3.6 pulse generator s the 71m6541d/f /g and 71m6542f/g provide fou r pulse generators, v pulse, wpulse, xpulse and ypulse, as well as hardware support for the v pulse and wpulse pulse generators . the pulse generators can be used to output ce status indicators, sag for example , to dio pins. all pulses can be configured to generate interrupts to the mpu. the polarity of the pulses may be inverted with control bit pls_inv (i/o ram 0x210c[0]) . when this bit is set, the pulses are active high, rather than the more usual active low. pls_inv inverts all four pulse outputs. the function of each pulse generator is determined by the ce code and the mpu code must configure the corresponding pulse outputs in agreement with the ce code. for example, standard ce code produces a mains zero - crossing pulse on xpulse and a sag pulse on ypulse . a common use of the zero - crossing pulses is to generate interrupt in order to drive real - time clock software in places where the mains frequency is sufficiently accurate to do so and also to adjust for cry stal aging. a common use for the sag pulse is to generate an interrupt that alerts the mpu when mains power is about to fail, so that the mpu code can store accumulated energy and other data to eeprom before the v3p3sys supply voltage actually drops. 2.3.6.1 xpulse and ypuls e pulses generated by the ce may be exported to the xpulse and ypulse pulse output pin s. pins segdio6 and segdio 7 are used for these pulses, respectively. gener ally, the xpulse and ypulse outputs can be updated once on each pass of the ce code . see 5.3 ce interface description on page 126 for details. 2.3.6.2 vpulse and wpulse referring to figure 12 , d uring each ce code pass the hardware stores exported wpulse and v pulse sign bits in an 8 - bit fifo and outputs them at a specified interval. this permits the ce code to calculate the vpulse and wpulse outputs at the beginning of its code pass and to rely on hardware to spread them ov er the multiplexer frame. as seen in figure 12 , t he fifo is reset at the beginning of each multiplexer frame. as also seen in figure 12 , t he i/o ram register pls_interval [7:0] (i/o ram 0x210b[7:0]) controls the delay to the first pulse update and the interval between subseque nt updates. the lsb of the pls_interval[7:0] register is equivalent to 4 ck_fir cycles (ck_fir is typically 4.9152mhz if pll_fast =1 and adc_div =0, but other ck_fir frequencies are possible; see the adc_div definition in table 76 . ) if pls_interval[7:0] =0 , the fifo is deactivated and the pulse outputs are updated immediately. the mux frame duration in units of ck_fir clock cycles is given by : if pll_fast =1: mux frame duration in ck_fir cycles = [1 + ( fir_len +1) * ( adc_div +1) * ( mux_div )] * [150 / ( adc_div +1)] if pll_fast =0: mux frame duration in ck_fir cycles = [ 3 + 3*( fir_len +1) * ( adc_div +1) * ( mux_div )] * [48 / ( adc_div +1)] pls_interval[7:0] in units of ck_fir clock cycles is calculated by: pls_interval [7:0] = floor (mux frame duration in ck_fir cycles / ce pulse updates per mux frame / 4 ) since the fifo resets at the beginning of each multiplexer frame, the user must specify pls_interva l[7: 0] so that all of the possible pulse updates occurring in one ce execution are output before the multiplexer frame completes. for instance, the 71m654 x c e code outputs six updates per multiplexer interval, and if the multiplexer interval is 1950 ck_fir cl ock cycles long, the ideal value for the interval is 1950/6 /4 = 81.25 . however, i f pls_interval [7:0] = 82 , the six th output occur s too late and would be lost. in this case, the proper value for pls_interval [7:0] is 81 (i.e., round down the result) . since one lsb of pls_interval[7:0] is equal to 4 ck_fir clock cycles, the pulse time interval t i in units of ck_fir clock cycles is: t i = 4* pls_interval[7:0] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 28 rev 5 if the fifo is enabled (i.e., pls_interval[7:0] 0), h ardware also provides a maximum pulse width feature in control register pls_max width[7:0] (i/o ram 0x210a) . by default, wpulse and vpulse are negative pulses (i.e., low level pulses, designed to sink current through an led). pls_maxwidth[7:0] determines the maximum negative pulse width t max in units of ck_fir clock cycles based on the pulse interval t i according to the formula: t max = (2 * pls_maxwidth [7:0] + 1) * t i if pls_maxwidth = 255 or pls_interval =0, no pulse width checking is performed, and the pulses default to 50% duty cycle. t max is typically programmed to 10 ms., which works well with most calibration systems. the polarity of the pulses may be inverted with the control bit pls_inv ( i/o ram 0x210c[0] ). when pls_inv is set, the pulses are active high. the default value for pls_inv is z ero, which selects active low pulses. the wpulse and v pulse pulse generator outputs are available on pins segdio0/wpulse and segdio1/vpulse , respectively (pins 45 and 44) . the pulses can also be output on opt_tx pin 53 (see opt_txe[1:0] , i/o ram 0x2456[3:2] for details). figure 12 . pulse generator fifo timing 2.3.7 ce functional overview the 71m654x provides an adc and multiplexer to sample the analog current s and voltage s as seen in figure 2 and figure 3 . the va and vb voltage sensors are formed by resistive voltage dividers directly connected to the 71m654x device, and therefore always use the adc and multip lexer facilities in the 71m654x device. current sensors, however, may be connected directly to the 71m654x or remotely connected through an isolated 71m6x01 device . the remo t e 71m6x01 sen sor has its own separate adc and voltage reference. when a current sensor is connected via a 71m6x01 isolated sensor, the 71m654x places the sample data received digitally over the isolation interface (via the pulse trans former) in the appropriate ce ram location, as shown in figure 3 . the adcs (i.e., adc in the 71m654x and the adc in the 71m6x01 ) process their corresponding sensor channels providing one sample per channel per multiplexer cycle. figure 14 (71m6541d/f /g ) and figure 15 ( 71m6542f/g ) show the sampling sequence when both current sensor s (ia and ib) are connected dire ctly to the 71m6541d/f /g as seen in figure 2 . however, w hen the ck32 mux_div conversions ( mux_div =6 is shown) settle adc mux frame mux_sync 150 wpulse s 0 s 1 s 2 s 3 s 4 s 5 ce code rst w_fifo s 0 s 1 s 2 s 3 s 4 s 5 s 0 s 1 s 2 s 3 s 4 s 5 4* pls_interval 2. if wpulse is low longer than ( 2 *pls_maxwidth+1) updates , wpulse will be raised until the next low - going pulse begins. 3. only the wpulse circuit is shown. the varpulse circuit behaves identicall y. 4. all dimensions are in ck_fir cycles (4.92mhz). 5. if pls_interval =0, fifo does not perform delay. 4* pls_interval 4* pls_interval 4* pls_interval 4* pls_interval 4* pls_interval 1. this example shows how the fifo distributes 6 pulse generator updates over one mux frame. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 29 ib channel is a 71m6x01 isolated sensor, the sample data does not pass through the 71m6541d/f /g multiplexer, as seen in figure 3 . in this case, the sample is taken during the second half of the multiplexer cycle and the data is directly stored in the corresponding ce ram location as indicated in figure 3 . the timing relationship between the remote current sensor channel and its corresponding voltage is precisely defin ed so that delay compensation can be properly applied by the ce. referring to figure 15 , the 71m6542f/g features an additional voltage input ( vb ) permi tting the implementation of a two - phase meter. as with va , the vb voltage divider is directly connected to the 71m6542f/g and uses the adc and multiplexer facilities in the 71m6542f/g . mux_div[3:0] = 4 configures the multiplexer to provide an additional time slot to accommodate the additional vb voltage sample. as with the 71m6541d/f /g, ia samples are obtained from a current sensor that is d irectly connected to the 71m6542f/g , while ib samples may be obtained from a directly connected ct or a remotely connected shunt using a 71m6x01 isolated device as seen in figure 2 and figure 3 . the number of samples processed during one accumulation cycle is controlled by the i/o r am register sum_samp s[12:0] (i/o ram 0x2107[4:0], 0x2108[7:0]) . the integration time for each energy output is : sum_samps / 2520.6, w here 2520.6 is the sample rate in hz for example, sum_samp s = 210 0 establish es 2100 samples per accumulation cycle , which ha s a duration of 833 ms. after an accumulation cycle is completed, the xfer_busy interrupt signals to the mpu that accumulated data are available. the end of each multiplexer cycle is signaled to the mpu by the ce_busy interrup t. at the end of each multiplexer cycle, status information, such as sag data and the digitized input s ignal, is available to the mpu. figure 13 shows the accumulation interval resulting from sum_samp s = 2100, consisting of 2100 samples of 397 s each, followed by the xfer_busy interrupt. the sampling in this example is applied to a 50 hz signal. there is no correlation between the line signal frequency and the choice of sum_samp s . furthermore, sampling does not have to start when the line voltage crosses the zero line, and the length of the accumulation interval need not be an integer multiple of the signal cycles. figure 13 : accumulation interval xfer_busy interrupt to mpu 20ms 833ms downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 30 rev 5 mux state ck32 (32768 hz) 0 1 2 mux_div[3:0] = 3 conversions settle multiplexer frame (13 x 30.518 s = 396.7 s -> 2520.6 hz) s s ia va ib 30.5 s 122.07 s 122.07 s 122.07 s figure 14 : samples from multiplexer cycle ( mux_div [3:0] = 3) mux state ck32 (32768 hz) 0 3 1 2 mux_div[3:0] = 4 conversions settle multiplexer frame (13 x 30.518 s = 396 s ? 2520hz) s s ia va ib 30.5 s 91.5 s 91.5 s 91.5 s 91.5 s vb figure 15 : samples from multiplexer cycle ( mux_div [3:0] = 4) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 31 2.4 80515 mpu core the 71m6541d/f /g and 71m6542f/g include an 80515 mpu (8 - bit, 8051 - compatible) that processes most instructions in one clock cycle. using a 4.9 mhz clock results in a processing throughput of 4.9 mips. the 80515 architecture eliminates redundant bus states and implements parallel ex ecution of fetch and execution phases. normally , a machine cycle is aligned with a memory fetch, therefore, most of the 1 - byte instructions are performed in a single machine cycle (mpu clock cycle) . this leads to an 8x average performance im prove ment (in terms of mips) over the intel 8051 device running at the same clock frequency . table 9 shows the ckmpu frequency as a function of the mck clock (19.6608 mhz) divided by the mpu clock divider which is set in the i/o ram control field mpu_div[2:0] (i/o ram 0x2200[2:0]) . actual p rocessor clocking speed can be adjusted to the total processing demand of the application (metering calculations, amr management, memory management, lcd driver management and i/o management) using mpu_div[2:0] , as shown in table 9 . table 9 : ckmpu clock frequencies mpu_div [2:0] ckmpu frequency 000 4.9152 mhz 001 2.4576 mhz 010 1.2288 mhz 011 614.4 k hz 100 307.2 khz 101 110 111 typical measurement and metering functions based on the results provided by the internal 32 - bit com pute engine (ce) are available for the mpu as part of the maxim standard library. maxim provides dem onstration source code to help reduce the design cycle. 2.4.1 memory organization and addressing the 80515 mpu core incorporates the harvard architecture with separate code and data spaces. mem ory organization in the 80515 is similar to that of the industr y standard 8051. there are three memory areas: program memory (flash, shared by mpu and ce), external ram (data ram, shared by the ce and mpu, configuration or i/o ram ), and internal data memory (internal ram). table 10 shows the mem ory map. program memory the 80515 can address up to 64 kb of program memory space ( 0x 00 0 0 to 0xffff ) . program memory is read when the mpu fetches instructions or performs a movc operation. after reset, the mpu starts program execution from program memory location 0x0000. the low er part of the program memory includes reset and interrupt vectors. the interrupt vect ors are spaced at 8 - byte in tervals, starting from 0x0003. mpu external data memory (xram) both internal and external memory is physically located on the 71m654x device . the e x ternal mem ory referred in this documentation is only external to the 80515 mpu core. 3 kb of ram starting at address 0x0000 is shared by the ce and mpu . the ce normally uses the fir st 1 kb, leaving 2 kb for the mpu. different versions of the ce code use varying amounts. consult the documentation for the specific code version being used for the exact limit. if the mpu overwrites the ces working ram, the ces output may be corrupted. if the ce is dis - abled, the first 0x40 bytes of ram are still unusable while mux_ div[3:0] 0 because the 71m654x adc writes to these locations. setting mux_ div[3:0] = 0 disables the adc output preventing the ce from writing the first 0x40 bytes of ram. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 32 rev 5 to change the slot assignments established by muxn_sel[3:0] , first set mux_div[3:0] to zero, then change the muxn_sel[3:0] slot assignments, and finally set mux_div[3:0] to the number of active mux frame slots. the 80515 writes into external data memory when the mpu executes a movx @ri,a or movx @dptr,a instruction. the mpu reads external data memory by executing a movx a,@ri or movx a,@dptr instruction ( pdata , sfr 0xb f , provides the upper 8 bytes for the movx a,@ri instruction) . internal and external memory map table 10 shows the address, type, use and size of the various memory components. table 10 : memory map address (hex) memory technology memory type name typical usage memory si ze (bytes) 0000 -7 fff flash memory non - volatile program memory for mpu and ce mpu program and non - volatile data 128/64/ 32 kb ? ce program (on 1 kb boundary) 3 kb max. 0000 - 0b ff static ram volatile external ram (xram) shared by ce and mpu 5/ 3 kb ? 2000 - 27 ff static ram volatile configuration ram ( i/o ram ) hardware control 2 kb 2800 - 28 7f static ram non - volatile (battery) configuration ram ( i/o ram ) battery - buffered memory 12 8 0000 - 00ff static ram volatile internal ram part of 80515 core 256 ? memory size depend s on ic. see 2.5.1 physical memory for details. movx addressing there are two types of instructions differing in whether they provide an 8 - bit or 16 - bit indirect address to the external data ram. in the first type, movx a,@ri, the contents of r0 or r1 in the current register bank prov ide the eight lower - ordered bits of address. the eight high - ordered bits of the address are specified with the pdata sfr. this method allows the user paged access (256 pages of 256 bytes each) to all ranges of the external data ram. in the second type of movx instruction, movx a,@dptr, the data pointer generates a 16 - bit address. this form is faster and more efficient when accessing very large data arrays (up to 64 kb ), since no additional instructions are needed to set up the eight high ordered bits of the address. it is possible to mix the two movx types. this provides the user with four separate data poin ters, two with direct access and two with paged access, to the entire external memory range. dual data pointer the dual data pointer accelerates the block moves of data. the standard dptr is a 16 - bit register that is used to address external memory or peripherals. in the 80515 core, the standard data pointer is called dptr , the second data pointer is called dptr1 . the data pointer select bit, located in the lsb of the dps register ( dps [0] , sfr 0x92 ), chooses the active pointer. dptr is selected when dps [0] = 0 a nd dptr1 is selected when dps [0] = 1. the user switches between pointers by toggling the lsb of the dps register. the values in the data pointers are not affected by the lsb of the dps register. all dptr related instructions use the currently selected dptr for any activity. the second data pointer may not be supported by certain compilers. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 33 dptr1 is useful for copy routines, where it can make the inner loop of the routine two instructions faster compared to the reloading of dptr from registers . any i nterrupt routine using dptr1 must save and restore dps , dptr and dptr1 , which increases stack usage and slows down interrupt latency. by selecting the r80515 core in the keil compiler project settings and by using the compiler directive modc2, dual data pointers are enabled in certain library routines. an alternative data pointer is available in the form of the pdata register ( sfr 0xbf ) , sometimes referred to as usr2 ) . it defines the high byte of a 16 - bit address when reading or writing xdata with the instruction movx a,@ri or movx @ri,a. internal data memory map and access the internal data memory provides 256 bytes (0x00 to 0xff) of data memory . the internal data memory address is always 1 byte wide . table 11 shows the internal data memory map. the special function registers (sfr) occupy the upper 128 bytes . the sfr area of internal data memory is available only by direct addressing . indirect a ddressing of this area accesses the upper 128 bytes of internal ram . the lower 128 bytes contain working registers and bit addressable memory . the lower 32 bytes form four banks of eight registers (r0 - r7) . two bits on the program memory status word ( psw , sfr 0xd0 ) select which bank is in use . the next 16 bytes form a block of bit addressable memory space at addresse s 0x00 - 0x7f . all the bytes in the lower 128 bytes are accessible through direct or indirect addressing . table 11 : internal data memory map address range direct addressing indirect addressing 0x80 0xff special function registers (sfrs) ram 0x30 0x7f byte addressable area 0x20 0x2f bit addressable area 0x00 0x1f register banks r0r7 2.4.2 special function registers (sfrs) a map of the special function registers is shown in table 12 . only a few addresses in the sfr memory space are occupied, the others are not im plemented. a read access to unimplemented addresses return s undefined data, while a write access ha s no effect. sfrs specific to the 71m654x are shown in bold print on a shaded field . the registers at 0x80, 0x88, 0x90, etc., are bit a ddressable, all others are byte addressable. table 12 : special function register map hex/ bin bit addressable byte addressable bin/ hex x000 x001 x010 x011 x100 x101 x110 x111 f8 flag1 stat remote0 spi1 ff f0 b f7 e8 iflags ef e0 a e7 d8 wdcon df d0 psw d7 c8 t2con cf c0 ircon c7 b8 ien1 ip1 s0relh s1relh pdata bf b0 p3 (dio12:15) flshctl fl_bank pgadr b7 a8 ien0 ip0 s0rell af a0 p2 (dio8:11) a7 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 34 rev 5 hex/ bin bit addressable byte addressable bin/ hex x000 x001 x010 x011 x100 x101 x110 x111 98 s0con s0buf ien2 s1con s1buf s1rell eedata eectrl 9f 90 p1 (dio4:7) dps erase 97 88 tcon tmod tl0 tl1 th0 th1 ckcon 8f 80 p0 (dio0:3) sp dpl dph dpl1 dph1 pcon 87 2.4.3 generic 80515 special function registers table 13 shows the location, description and reset or power - up value of the generic 80515 sfrs . additional descriptions of the registers can be found at the page numbers listed in the table. table 13 : generic 80515 sfrs - location and reset values name address (hex) reset value (hex) description page p0 0x80 0xff port 0 36 sp 0x81 0x07 stack pointer 35 dpl 0x82 0x00 data pointer low 0 35 dph 0x83 0x00 data pointer high 0 35 dpl1 0x84 0x00 data pointer low 1 35 dph1 0x85 0x00 data pointer high 1 35 pcon 0x87 0x00 uart speed control 39 tcon 0x88 0x00 timer/counter control 42 tmod 0x89 0x00 timer mode control 40 tl0 0x8a 0x00 timer 0, low byte 40 tl1 0x8b 0x00 timer 1, high byte 40 th0 0x8c 0x00 timer 0, low byte 40 th1 0x8d 0x00 timer 1, high byte 40 ckcon 0x8e 0x01 clock control (stretch=1) 36 p1 0x90 0xff port 1 36 dps 0x92 0x00 data pointer select register 32 s0con 0x98 0x00 serial port 0, control register 38 s0buf 0x99 0x00 serial port 0, data buffer 37 ien2 0x9a 0x00 interrupt enable register 2 42 s1con 0x9b 0x00 serial port 1, control register 39 s1buf 0x9c 0x00 serial port 1, data buffer 37 s1rell 0x9d 0x00 serial port 1, reload register, low byte 37 p2 0xa0 0xff port 2 36 ien0 0xa8 0x00 interrupt enable register 0 42 ip0 0xa9 0x00 interrupt priority register 0 45 s0rell 0xaa 0xd9 serial port 0, reload register, low byte 37 p3 0xb0 0xff port 3 36 ien1 0xb8 0x00 interrupt enable register 1 42 ip1 0xb9 0x00 interrupt priority register 1 45 s0relh 0xba 0x03 serial port 0, reload register, high byte 37 s1relh 0xbb 0x03 serial port 1, reload register, high byte 37 pdata 0xbf 0x00 high address byte for movx@ri - also called usr2 32 ircon 0xc0 0x00 interrupt request control register 43 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 35 name address (hex) reset value (hex) description page t2con 0xc8 0x00 polarity for int2 and int3 43 psw 0xd0 0x00 program status word 35 wdcon 0xd8 0x00 baud rate control register (only wdcon[ 7] bit used) 37 a 0xe0 0x00 accumulator 35 b 0xf0 0x00 b register 35 accumulator ( acc , a , sfr 0x e0 ): acc is the accumulator register . most instructions use the accumulator to hold the operand . the mnemonics for accumulator - specific instructions refer to accumulator as a , not acc . b register ( sfr 0xf0 ) : the b register is used during multiply and divide instructions . it can also be u sed as a scratch - pad register to hold temporary data. program status word ( psw , sfr 0xd0 ): this register contains various flags and control bits for the selection of the register banks (see table 14 ). table 14 : psw bit functions ( sfr 0xd0 ) psw bit symbol function 7 cv carry flag . 6 ac auxiliary carry flag for bcd operations . 5 f0 general purpose flag 0 available for user. f0 is not to be confused with the f0 flag in the cestatus register. 4 rs1 register bank select control bits . the contents of rs1 and rs0 select the working register bank: rs1/rs0 bank selected location 00 bank 0 0x00 C 0x07 01 bank 1 0x08 C 0x0f 10 bank 2 0x10 C 0x17 11 bank 3 0x18 C 0x1f 3 rs0 2 ov overflow flag . 1 C user defined flag . 0 p parity flag, affecte d by hardware to indicate odd or even number of one bits in the accumulator, i.e., even parity. s tack pointer ( sp , sfr 0x8 1 ) : the stack pointer is a 1 - byte register initialized to 0x07 after reset . this register is incremented before push and call instructions, causing the stack to begin at location 0x08. data pointer: the data pointer s ( dptr and dprt1 ) are 2 bytes wide . the lower part is dpl (sfr 0x82) and dpl1 (sfr 0x84), respectively . t he highest is dph (sfr 0x83) and dph1 (sfr 0x85), respectively . the data pointers can be loaded as two registers ( e.g., mov dpl,#data8) . they are generally used to access external code or data space ( e.g., movc a,@a+dptr or movx a,@dptr respectively). program counter: the program counter ( pc ) is 2 bytes wide and initialized to 0x0000 after reset . this register is incremented when fetching operation code or when operating on data from program memory . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 36 rev 5 port registers: segdio0 through segdio15 are controlled by special function registers p0 , p1 , p2 and p3 as shown in table 15 . a bove segdio15, the lcd _ segdio n [ ] registers in i/o ram are used . since the direction bits are contained in the upper nibble of each sfr pn register and the dio bits are contained in the lower nibble, it is possible to configure the direction of a given dio pin and set its ou t put value with a single write operation, thus facilitating the implementation of bit - banged interfaces. writing a 1 to a dio_dir bit con figures the corresponding dio as an output , while writing a 0 configures it as an in put. writing a 1 to a dio bit causes the corresponding pin to be at hi gh level (v3p3) , while w riting a 0 causes the corresponding pin to be held at a low level (gnd) . s ee 2.5.8 digital i/o for additional details. table 15 : port registers (segdio0 - 15) sfr name sfr address d7 d6 d5 d4 d3 d2 d1 d0 p0 0x80 dio_dir[3:0] dio[3:0] p1 0x90 dio_dir[7:4] dio[7:4] p2 0x a0 dio_dir[11:8] dio[11:8] p3 0x b0 dio_dir[15:12] dio[15:11] p orts p0 - p3 on the chip are bi - directional and control segdio0 - 15 . each port consists of a latch (sfr p0 to p3 ), an output driver and an input buffer, therefore the mpu can output or read data through any of these ports . even if a dio pin is configured as an output, the state of the pin can still be read by the mpu, for example when counting pulses issued via dio pins that are under ce control. at power - up segdio0 - 15 are configured as out puts , but the pins are in a high - imped ance state because port_e =0 ( i/o ram 0x270c[5] ) . host firmware should first configure segdio0 - 15 to the desired state, then set port_e = 1 to enable the function . clock stretching ( ckcon ) the three low order bits of the ckcon [2:0] (sfr 0x8e) register define the stretch memor y cycles that are used for movx instructions when access ing external peripherals. the practical value of this register for the 71m6541d/f /g and 71m6542f/g is to guarantee access to xram between ce, mpu, and spi . table 16 shows how the signals of the external memory interface change when stretch values are set from 0 to 7. the widths of the signals are counted in mpu clock cycles. the post - reset state of the ckcon [2:0] (001) , which is shown in bold in the table, performs the movx instructions with a stretch value equal to 1. table 16 : stretch memory cycle width ckcon[2:0] stretch value read s ignal w idth write s ignal w idth memaddr memrd memaddr memwr 000 0 1 1 2 1 001 1 2 2 3 1 010 2 3 3 4 2 011 3 4 4 5 3 100 4 5 5 6 4 101 5 6 6 7 5 110 6 7 7 8 6 111 7 8 8 9 7 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 37 2.4.4 instruction set all instructions of the generic 8051 microcontroller are supported . a complete list of the instruction set and of the associated op - codes is contained in the 71m65 4x software users guide (sug) . 2.4.5 uarts the 71m6541d/f /g and 71m6542f/g include a uart (uart0) that can be programmed to communicate with a variety of amr modules and other external devices . a second uart (uart1) is connected to the optical port, as described in 2.5.7 uart and optical interface . the uarts are dedicated 2 - wire serial interfaces, which can communicate with an extern al host processor at up to 38,400 bits/s (with mpu clock = 1.2288 mhz) . the operation of the rx and tx uart0 pins is as follows: ? uart0 rx: serial input data are applied at this pin . conforming to rs - 232 standard, the bytes are input lsb first. ? uart0 tx : this pin is used to output the serial data . the bytes are output lsb first. s everal uart - related registers are available for the control and buffering of serial data . a single sfr register serves as both the transmit buffer and receive buffer ( s0buf , sfr 0x99 for uart0 and s1buf , sfr 0x9c for uart1). when written by the mpu, sxbuf acts as the transmit buffer, and when read by the mpu, it acts as the receive buffer. writing data to the transmit buffer starts the transmission by the associated u art. re ceived data are available by reading from the receive buffer. both uarts can simultaneously transmit and receive data. wdcon [7] (sfr 0xd8) selects whether timer 1 or the internal baud rate generator is used . all uart transfers are programmable for parity enable, parity, 2 stop bits/1 stop bit and xon/xoff options for variable communication baud rates from 300 to 38400 bps . table 17 shows how the baud rates are cal culated . table 18 shows the selectable uart operation modes. table 17 : baud rate generation using timer 1 ( wdcon [7] = 0) using internal baud rate generator ( wdcon [7] = 1) uart0 2 smod * f ckmpu / (384 * (256 - th1 )) 2 smod * f ckmpu /(64 * (2 10 - s0rel )) uart1 n/a f ckmpu /(32 * (2 10 - s1rel )) s0rel a nd s1rel are 10 - bit values derived by combining bits from the respective timer reload registers . ( s0rell, s0relh, s1rell, s1relh are sfr 0xaa, sfr 0xba, sfr 0x9d and sfr 0xbb , respectively) smod is the smod bit in the sfr pcon register ( sfr 0 x87 ) . th1 (sfr 0x8d) is the high byte of timer 1. table 18 : uart modes uart 0 uart 1 mode 0 n/a start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator) mode 1 start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator or timer 1) start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator) mode 2 start bit, 8 data bits, parity, stop bit, fixed baud rate 1/32 or 1/64 of f ckmpu n/a mode 3 start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator or timer 1) n/a parity of serial data is available through the p flag of the accumulator . 7- bit serial modes with parity, such as those used by the flag protocol, can be simulated by setting and reading bit 7 of downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 38 rev 5 8- bit output data . 7- bit serial modes without parity can be simulated by setting bit 7 to a constant 1 . 8- bit serial modes with parity can be simulated by setting and reading the 9 th bit, using the control bits t b80 ( s0con [ 3 ] ) and tb81 ( s1con [3] ) in the s0co n ( sfr 0x98 ) and s1con ( sfr 0x9b ) registers for transmit and rb81 bit in s1con [2] for receive operations . t he feature of receiving 9 bits (mode 3 for uart0, mode a for uart1) can be used as handshake s ignals for inter - processor communication in multi - processor systems. in this case, the slave processors have bit sm20 ( s0con[5] ) for uart0, or sm21 ( s1con[5] for uart1, set to 1. when the master processor outputs the slaves address, it sets the 9 th bit to 1, causing a serial port receive interrupt in all the slaves. the slave processors compare the received byte with their address. if there is a match, the addressed sl ave clear s sm20 or sm21 and receive the rest of the message. the rest of the slaves ignore s the message. after addressing the slave, the host outputs the rest of the message with the 9 th bit set to 0, so no additional serial port receive interrupts are generated. uart control registers: the function s of uart0 and uart1 depend on the setting of the serial port control register s s0con and s1con shown in table 19 and table 20 , respectively , and the pcon register shown in table 21 . since the ti0 , ri0 , ti1 and ri1 bits are in an sfr bit addressable byte, common practice would be to clear them with a bit operation, but this must be avoided . the hardware implements bit operations as a byte wide read - modify - write hardware macro. if an interrupt occurs after the read, but before the write, its flag is cleared unintentionally. the proper way to clear these flag bits is to write a byte mask consisting of all ones except for a zero in the location of the bit to be cleared. the flag bits are configured in hardware to ignore ones written to them. table 19 : the s0con (uart0) register (sfr 0x98) bit symbol function s0con [7] sm0 the sm0 and sm1 bits set the uart0 mode: mode description sm0 sm1 0 n/a 0 0 1 8- bit uart 0 1 2 9- bit uart 1 0 3 9- bit uart 1 1 s0con [6] sm1 s0con [5] sm20 enables the inter - processor communication feature. s0con[4] ren0 if set, enables serial reception. cleared by software to disable reception. s0con[3] tb80 the 9th transmitted data bit in modes 2 and 3. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s0con[2] rb80 in modes 2 and 3 it is the 9 th data bit received. in mode 1, sm20 is 0, rb80 is the stop bit. in mode 0, this bit is not used. must be cleared by software. s0con[1] ti0 transmit interrupt flag; set by hardware after completion of a serial transfer. must be cleared by software (see caution above) . s0con[0] ri0 receive interrupt flag; set by hardware after completion of a serial reception. must be cleared by software (see caution above) . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 39 table 20 : the s1con (uart1) r egister (sfr 0x9b) bit symbol function s1con [7] sm sets the baud rate and mode for uart1. sm mode description baud rate 0 a 9- bit uart variable 1 b 8- bit uart variable s1con [5] sm21 enables the inter - processor communication feature. s1con [4] ren1 if set, enables serial reception . cleared by software to disable reception. s1con [3] tb81 t he 9 th transmitted data bit in mode a . set or cleared by the mpu, de pending on the function it performs (parity check, multiprocessor communication etc.) s1con [2] rb81 in modes a and b, it is t he 9 th data bit received . in mode b, if sm21 is 0, rb81 is the stop bit . must be cleared by software s1con [1] ti1 transmit interrupt flag, set by hardware after completion of a serial transfer . must be cleared by software (see caution above) . s1con [0] ri1 receive interrupt flag, set by hardware after completion of a serial rec eption . must be cleared by software (see caution above) . table 21 : pcon register bit description (sfr 0x87) bit symbol function pcon[7] smod the smod bit doubles the baud rate when set 2.4.6 timers and counters the 80515 has two 16 - bit timer/counter registers: timer 0 and timer 1 . these registers can be configured for counter or timer operations. in timer mode, the register is incremented every machine cycle, i.e. , it counts up once for every 12 periods of the mpu clock. in counter mode, the register is incremented when the falling edge is observed at t he corresponding input signal t0 or t1 (t0 and t1 are the timer gating inputs derived from certain dio pins, see 2.5.8 digital i/o ) . since it takes 2 machine cycles to recognize a 1 - to - 0 event, the maximum input count rate is 1/2 of the cl o ck frequency (ckmpu) . there are no restrictions on the duty cycle, however to ensure proper recognition of the 0 or 1 state, an inp ut should be stable for at least 1 machine cycle. four operating modes can be selected for timer 0 and timer 1, as shown in table 22 and table 23 . the tmod ( sfr 0x89 ) register, shown in table 24 , is used to select the appropriate mode. the timer/counter operation is controlled by the tcon ( sfr 0x88 ) register, which is shown in table 25 . bits tr1 ( tcon [6] ) and tr0 ( tcon [4] ) in the tcon register start their associated timers when set. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 40 rev 5 table 22 : timers/counters mode description m1 m0 mode function 0 0 mode 0 13 - bit counter/timer mode with 5 lower bits in the tl0 or tl1 ( sfr 0x8a or sfr 0x8b ) register and the remaining 8 bits in the th0 or th1 ( sfr 0x8c or sfr 0x8d ) register (for timer 0 and timer 1, respectively) . the 3 high order bits of tl0 and tl1 are held at zero. 0 1 mode 1 16 - bit counter/timer mode . 1 0 mode 2 8- bit auto - reload counter/timer . the reload value is kept in th0 or th1 , while tl0 or tl1 is incremented every machine cycle . when tl( x) overflows, a value from th( x) is copied to tl (x) (where x is 0 for counter/timer 0 or 1 for counter/timer 1 . 1 1 mode 3 if tim er 1 m1 and m0 bits are set to 1, timer 1 stops . if tim er 0 m1 and m0 bits are set to 1, timer 0 acts as two in dependent 8- bit timer/counters. in mode 3, tl0 is affected by tr0 and gate control bits, and sets the tf0 flag on overflow, while th0 is affected by the tr1 bit, and the tf1 flag is set on overflow. table 23 specifies the combinations of operation modes allowed for timer 0 and timer 1. table 23 : allowed timer /counter mode combinations timer 1 mode 0 mode 1 mode 2 timer 0 - mode 0 yes yes yes timer 0 - mode 1 yes yes yes timer 0 - mode 2 not allowed not allowed yes table 24 : tmod register bit description (sfr 0x89) bit symbol function timer/counter 1 tmod[ 7] gate if tmod[ 7] is set, external input signal control is enabled for counter 1. the tr1 bit in the tcon register ( sfr 0x88 ) must also be set in order for counter 1 to increment. with these settings, counter 1 increments on every falling edge of the logic signal applied to one or more of the segdio2 - 11 pins, as specified by the contents of the dio_r2 through dio_r11 registers. see 2.5.8 digital i/o and lcd segment drivers and table 47 . tmod[ 6] c/t selects timer or counter operation. when set to 1, a counter operation is perfor med. when cleared to 0, the corresponding register function s as a t imer. tmod[ 5:4] m1:m0 selects the mode for timer/counter 1, as shown in table 22 . timer/counter 0: tmod[ 3] gate if tmod[ 3] is set, external input signal control is enabled for counter 0. the tr 0 bit in the tcon register ( sfr 0x88 ) must also be set in order for counter 0 to increment. with these settings, c ounter 0 is increment ed on every falling edge of the logic signal applied to one or more of the segdio2 - 11 pins, as sp ecified by the contents of the dio_r2 through dio_r11 registers. see 2.5.8 digital i/o and lcd segment drivers and table 47 . tmod[ 2] c/t s elects timer or counter operation. when set to 1, a counter operation is per formed. when cleared to 0, the corresponding register function s as a timer. tmod[ 1:0] m1:m0 selects the mode for timer/counter 0 as shown in table 22 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 41 table 25 : the tcon register bit functions (sfr 0x88) bit symbol function tcon[7] tf1 the timer 1 overflow flag is set by hardware when timer 1 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[6] tr1 timer 1 run control bit. if cleared, timer 1 stops. tcon[5] tf0 timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[4] tr0 timer 0 run control bit. if cleared, timer 0 stops. tcon[3] ie1 interrupt 1 edge flag is set by hardware when the falling edge on external pin int1 is observed. cleared when an interrupt is processed. tcon[2] it1 interrupt 1 type control bit. selects either the falling edge or low level on input pin to cause an interrupt. tcon[1] ie0 interrupt 0 edge flag is set by hardware when the falling edge on external pin int0 is observed. cleared when an interrupt is processed. tcon[0] it0 interrupt 0 type control bit. selects either the falling edge or low level on input pin to cause interrupt. 2.4.7 wd timer (software watchdog timer) there is no int ernal software watchdog timer . use the standard hardware watchdog timer instead (see 2.5 .11 hardware watchdog timer ). 2.4.8 interrupt s the 80515 provides 11 interrupt sources with four priority levels . each source has its own interrupt request flag(s) located in a special function register ( tcon , ircon , and scon ) . each interrupt requested by the corresponding interrupt flag can be individually enabled or disabled by the interrupt enable bits in the ien0 (sfr 0xa8) , ien1 (sfr 0xb8) , and ien2 (sfr 0x9a) . figure 16 shows the device interrupt structure. referring to figure 16 , interrupt sources can or iginate f rom within the 80515 mpu core (referred to as internal sources ) or can originate from other parts of the 71m654x soc (referred to as external sources ). there are seven external interrupt sources, as seen in the leftmost part of figure 16 , and in table 26 and table 27 (i.e., ex0 - ex6 ). i nterrupt overview when an interrupt occurs, the mpu vector s to the predetermined address as shown in table 38 . once the interrupt service has begun, it can be interrupted only by a higher priorit y interrupt . the interrupt service is terminated by a return from interrupt instruction, reti . when a r eti instruction is performed, the processor return s to the instruction that would have been next when the interrupt occurred. when the interrupt condition occurs, the processor also indicate s this by setting a flag bit . this bit is set regardless of whether the interrupt is enabled or disabled . each interrupt flag is sampled once per machine cycle, and then samples are polled by the hardware . if the sample indicates a pending interrupt when the interrupt is enabled, then the interrupt request flag is set . on the next instruction cycle, the in terrupt is acknowledged by hardware forcing an lcall to the appropriate vector address, if the following conditions are met: ? no interrupt of equal or higher priority is already in progress. ? an instruction is cur rently being executed and is not completed. ? the instruction in progress is not reti or any write access to the registers ien0 , ien1 , ien2 , ip0 or ip1 . special function registers for interrupts the following sfr registers control the interrupt functions: ? the interrupt enable registers: ien0 , ien1 and ien2 (see table 26 , table 27 and table 28 ). ? the timer/counter control registers, tcon and t2con (see ? table 29 and table 30 ). ? the interrupt request r egister , ircon (see table 31 ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 42 rev 5 ? the interrupt priority registers: ip0 and ip1 (see table 36 ). table 26 : the ien0 bit functions (sfr 0xa8) bit symbol function ien0 [7] eal eal = 0 disable s all interrupts . ien0 [6] C not used . ien0 [5] C not u sed. ien0 [4] es0 es0 = 0 disable s serial channel 0 interrupt . ien0 [3] et1 et1 = 0 disable s timer 1 overflow interrupt . ien0 [2] ex1 ex1 = 0 disable s external interrupt 1 : dio status change ien0 [1] et0 et0 = 0 disable s timer 0 overflow interrupt . ien0 [0] ex0 e x0 = 0 disable s external interrupt 0 : dio status change table 27 : the ien1 bit functions (sfr 0xb8) bit symbol function ien1 [7] C not used. ien1 [6] C not used. ien1 [5] ex6 ex6 = 0 disable s external interrupt 6 : xfer_busy, rtc_1s, rtc_1m or rtc_t ien1 [4] ex5 ex5 = 0 disable s external interrupt 5 : eeprom or spi ien1 [3] ex4 ex4 = 0 disable s external interrupt 4 : vstat ien1 [2] ex3 ex3 = 0 disable s external interrupt 3 : ce_busy ien1 [1] ex2 ex2 = 0 disable s external interrupt 2 : xpulse, ypulse, wpulse or vpulse ien1 [0] C not u sed. table 28 : the ien2 bit functions (sfr 0x9a) bit symbol function ien2[0] es1 es1 = 0 disable s the serial channel 1 interrupt . table 29 : tcon bit functions (sfr 0x88) bit symbol function tcon[7] tf1 timer 1 overflow flag . tcon[6] tr1 not used for interrupt control . tcon[5] tf0 timer 0 overflow flag . tcon[4] tr0 not used for interrupt control . tcon[3] ie1 external interrupt 1 flag : dio status changed tcon[2] it1 external interrupt 1 type control bit : 0 = interrupt on low level. 1 = interrupt on falling edge. tcon[1] ie0 external interrupt 0 flag: dio status changed tcon[0] it0 external interrupt 0 type control bit : 0 = interrupt on low level. 1 = interrupt on falling edge. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 43 table 30 : the t2con b it functions (sfr 0xc8) bit symbol function t2con[7] C not used. t2con[6] i3fr polarity control for external interrupt 3 : ce_busy 0 = falling edge. 1 = rising edge. t2con[5] i2fr polarity control for external interrupt 2: xpulse, ypulse, wpulse and vpulse 0 = falling edge. 1 = rising edge. t2con[4:0] C not used. table 31 : the ircon bit functions (sfr 0xc0) bit symbol function ircon[7] C not used ircon[6] C not used ircon[5] iex6 1 = external interrupt 6 flag : xfer_busy, rtc_1s, rtc_1m or rtc_t irco n[4] iex5 1 = external interrupt 5 flag : eeprom or spi ircon[3] iex4 1 = external interrupt 4 flag : vstat ircon[2] iex3 1 = external interrupt 3 flag : ce_busy ircon[1] iex2 1 = external interrupt 2 flag : xpulse, ypulse, wpulse or vpulse ircon[0] C not used. tf0 and tf1 (timer 0 and timer 1 overflow flag s ) are automatically cleared by hardware when the service routine is called (signals t0ack and t1ack C port isr C active high when the service routine is called). ie0 , ie1 and iex2 - iex6 are cleared automatically when hardware causes execution to vector to the interrupt service routine. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 44 rev 5 external mpu interrupts the seven external interrupts are the interrupts external to the 80515 core, i.e., signals that originate in other parts of the 71m654x , for example the ce, dio, rtc , or eeprom interface. the external interrupts are connected as shown in table 32 . the po larity of interrupts 2 and 3 is programmable in the mpu via the i3fr and i2fr bits in t2con (sfr 0xc8) . interrupts 2 and 3 should be programmed for falling sensitivity ( i3fr = i2fr = 0). the generic 8051 mpu literature states that interrupts 4 through 6 are defined as rising - edge sensitive. thus, the hardware signals attached to interrupts 5 and 6 are in verted to achieve the edge polarity shown in table 32 . table 32 : external mpu interrupts external interrupt connection polarity flag reset 0 digital i/o (ie0) see 2.5.8 automatic 1 digital i/o (ie1) see 2.5.8 automatic 2 ce_pulse (ie_xpulse, ie_ypulse, ie_wpulse, ie_vpulse) rising manual 3 ce_busy (ie3) falling automatic 4 vstat ( vstat[2:0] changed ) (ie4) rising automatic 5 eeprom busy (falling), spi (rising) (ie_eex, ie_spi) manual 6 xfer_busy (falling), rtc_1sec, rtc_1min, rtc_ t (ie_xfer, ie_rtc1s, ie_rtc1m, ie_rtct) falling manual external interrupt 0 and 1 can be mapped to pins on the device using dio resource maps. see 2.5.8 digital i/o for more information. sfr enable bits must be set to permit any of these interrupts to occur . likewise, each interrupt has its own flag bit, which is set by the interrupt hardware, and reset by the mpu int errupt handler . xfer_busy, rtc_1sec, rtc_1min , rtc_ t , spi, pllrise and pllfall have their own enable and flag bits in add ition to the interrupt 6, 4 and enable and flag bits (see table 33 : interrupt enable and flag bits ). ie0 through iex6 are cleared automatically when the hardware vectors to the interrupt handler . the other flags, ie_xfer through ie_vpulse , are cleared by writing a zero to them . since these bits are in an sfr bit addressable byte, common practice would be to clear them with a bit operation, but this must be avoided . the hardware implements bit operations as a byte wide read - modify - write hardware macro . if an interrupt occurs after the read, but before the write, its flag cleared un intentionally . the proper way to clear the flag bits is to write a byte mask consisting of all ones except for a zero in the location of the bit to be cleared . the flag bits are configured in hardware to ignore ones written to them. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 45 table 33 : interrupt enable and flag bits interrupt enable interrupt flag interrupt description name location name location ex0 sfr 0x a8[[0] ie0 sfr 0x88[1] external interrupt 0 ex1 sfr 0xa8[2] ie1 sfr 0x88[3] external interrupt 1 ex2 sfr 0xb8[1] iex2 sfr 0xc0[1] external interrupt 2 ex3 sfr 0xb8[2] iex3 sfr 0xc0[2] external interrupt 3 ex4 sfr 0xb8[3] iex4 sfr 0xc0[3] external interrupt 4 ex5 sfr 0xb8[4] iex5 sfr 0xc0[4] external interrupt 5 ex6 sfr 0xb8[5] iex6 sfr 0xc0[5] external interrupt 6 ex_xfer ex_rtc1s ex_rtc1m ex_rtc t ex_spi ex_eex ex_xpulse ex_ypulse ex_wpulse ex_vpulse 0x2700[0] 0x2700[1] 0x2700[2] 0x2700[4] 0x2701[7] 0x2700[7] 0x2700[6] 0x2700[5] 0x2701[6] 0x2701[5] ie_xfer ie_rtc1s ie_rtc1m ie_rtc t ie_spi ie_eex ie_xpulse ie_ypulse ie_wpulse ie_vpulse sfr 0xe8[0] sfr 0xe8[1] sfr e 0x8[2] sfr 0xe8[4] sfr 0xf8[7] sfr 0xe8[7] sfr 0xe8[6] sfr 0xe8[5] sfr 0xf8[ 6] sfr 0xf8[ 5] xfer_busy interrupt ( int 6) rtc_1sec interrupt ( int 6) rtc_1min interrupt ( int 6) rtc_ t alarm clock interrupt ( int 6) spi interrupt eeprom interrupt ce_xpulse interrupt ( int 2) ce_ypulse interrupt ( int 2) ce_w pulse interrupt ( int 2) ce_vpulse interrupt ( int 2) interrupt priority level structure all interrupt sources are combined in groups, as shown in table 34 . table 34 : interrupt priority level groups group group members 0 external interrupt 0 serial channel 1 interrupt 1 timer 0 interrupt external interrupt 2 2 external interrupt 1 external interrupt 3 3 timer 1 interrupt external interrupt 4 4 serial channel 0 interrupt external interrupt 5 5 external interrupt 6 each group of interrupt sources can be programmed individually to one of four priority levels (as shown in table 35 ) by setting or clearing one bit in the sfr interrupt priority register ip0 ( sfr 0xa9 ) and one in ip1 (sfr 0xb9) ( table 36 ) . if requests of the same priority level are received simultaneously, an internal po lling sequence as shown in table 37 determines which request is serviced first. changing interrupt priorities while interrupts are enabled can easily cause software defects. it is best to set the interrupt priority registers only once during initialization before interrupts are enabled. table 35 : interrupt priority levels ip1 [x] ip0 [x] priority level 0 0 level 0 (lowest) 0 1 level 1 1 0 level 2 1 1 level 3 (highest) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 46 rev 5 table 36 : interrupt priority registers ( ip0 and ip1 ) register address bit 7 (msb) bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (lsb) ip0 sfr 0xa9 C C ip0[5] ip0[4] ip0[3] ip0[2] ip0[1] ip0[0] ip1 sfr 0xb9 C C ip1[5] ip1[4] ip1[3] ip1[2] ip1[1] ip1[0] table 37 : interrupt polling sequence external interrupt 0 polling sequence serial channel 1 interrupt timer 0 interrupt external interrupt 2 external interrupt 1 external interrupt 3 timer 1 interrupt external interrupt 4 serial channel 0 interrupt external interrupt 5 external interrupt 6 interrupt sources and vectors table 38 shows the interrupts with their associated flags and vector addresses. table 38 : interrupt vectors interrupt request flag description interrupt vector address ie0 external interrupt 0 0x0003 tf0 timer 0 interrupt 0x000b ie1 external interrupt 1 0x0013 tf1 timer 1 interrupt 0x001b ri0/ti0 serial channel 0 interrupt 0x0023 ri1/ti1 serial channel 1 interrupt 0x0083 iex2 external interrupt 2 0x004b iex3 external interrupt 3 0x0053 iex4 external interrupt 4 0x005b iex5 external interrupt 5 0x0063 iex6 external interrupt 6 0x006b downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 47 figure 16 : interrupt structure downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 48 rev 5 2.5 on - chip resources 2.5.1 physical memory 2.5.1.1 flash memory the device includes 128kb ( 71m6541g, 71m6542g), 64 kb (71m6542f, 71m6541f) or 32 kb (71m6541d) of on - chip flash memory. the flash memory primarily contains mpu and ce program code. it also contains images of the ce r am and i/o ram. on power - up, be fore enabling the ce, the mpu copies these images to their respective locations. f lash space allocated for the ce program is limited to 4096 16 - bit words ( 8 kb). t he ce program must begin on a 1 - kb boundary of the flash address space. the ce_lctn[ 5 :0] field ( i/o ram 0x2109[5:0] ) defines which 1 kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[5 :0] . flash memory can be accessed by the mpu, the ce, and by the spi interface (r/w). table 39 : flash memory access access by access type condition mpu r/w/e w/e only if ce is disabled. ce r spi r/w /e access only when sfm is invoked (mpu halted). flash write procedures if the flsh_unlock [ 3:0] (i/o ram 0x2702[7:4] key is correctly programmed, t he mpu may write to the flash memory. this is one of the non - volatile storage options available to the user in addition to external eeprom. the flash program write enable bit, flsh_pwe (sfr 0xb2[0]) , differentiates 80515 data store instructions (movx@dptr,a) between flash and xram writes. this bit is automatically cleared by h ardware after each byte write operation. write operations to this bit are inhibited when interrupts are enabled. if the ce b it is enabled ( ce_e = 1 , i/o ram 0x2106[0] ), flash write operations must not be attempted unless flsh_ pstwr (sfr 0xb2[2] ) is set. this bit enables the posted flash write capability. flsh_ pstwr ha s no effect w hen ce_e = 0). when ce_e = 1, however, flsh_ pstwr delay s a flash write until the time interval b etween the ce code passes. during this delay time, the flsh_pend bit ( sfr 0xb2[3] ) is high, and the mpu continue s to execute commands. when the ce code pass ends (ce_busy falls), the flsh_pend bit fall s and the write operation occur s . the mpu can query the flsh_pend bit to determine when the write operation has been completed. while flsh_pend = 1, further flash write requests are ignored. updating individual bytes in flash m emory the original state of a flash byte is 0xff (all bits are 1). once a value other than 0xff is written to a flash memory cell, over writing with a different value usually requires that the cell be erased first. since c ells cannot be erased individually, the page has to be copied to ram, followed by a page erase. after this, the page can be updated in ram and then written back to the flash memory. flash erase procedures flash erasure is initiated by writing a specific data pattern to specific sf r registers in the proper sequence. these special pattern/sequence requirements prevent inadvertent erasure of the flash me mory. the mass erase sequence is: ? write 1 to the flsh_meen bit ( sfr 0xb2[1] ). ? write the pattern 0xaa to the flsh_erase register ( sfr 0x94 ). the mass erase cycle can only be initiated when the ice port is enabled. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 49 the page erase sequence is: ? write the page address to flsh_pgadr [5 :0] ( sfr 0xb7[7: 2]) . ? write the pattern 0x55 to the flsh_erase register ( sfr 0x94 ). program security when enabled, the security feature limits the ice to global flash erase operations only. all other ice op erations are blocked. this guarantees the security of the users mpu and ce program code. securit y is enabled by mpu code that is executed in a 64 ckmpu cycle pre - boot interval before the primary boot sequence begins. once security is enabled, the only way to disable it is to perform a global erase of the flash, followed by a chip reset. the first 64 cycles of the mpu boot code are called the pre - boot phase because during this phase the ice is inhibited. a read - only status bit, preboot (sfr 0xb2[7]) , identifies these cycles to the mpu. upon completion of pre - boot, the ice can be enabled and is permitted to take control of the mpu. t he security enable bit, secure (sfr 0xb 2[6]) , is reset whenever the chip is reset. hardware associated with the bit permits only ones to be written to it. thus, pre - boot code may set secure to enable the security f eature but may not reset it. once secure is set, the pre - boot code is protected and n o external read of program code is possible . specifically, when the secure bit is set , the following applies : ? the ice is limited to bulk flash erase only. ? page zero of flash memory, the preferred location for the users pre - boot code, may not be page - erased by either mpu or ice. page zero may only be erased with global flash erase. ? write operation s to page zero, whether by mpu or ice are inhibited. the 71m6541d/f /g and 71m6542f/g also include hardware to protect against unintentional flash write and erase. to enable flash write and erase operations, a 4 - bit hardware key that must be written to the flsh_unlock[3:0] field . the key is the binary number 0010 . if flsh_unlock[3:0] is not 0010, the flash erase and write operation is inhibited by hardware. proper operation of this security key requires that there be no firmware function that writes 0010 to flsh_unlock[3:0] . the key should be written by the external spi master, in the case of spi flash programming (sfm mode), or through the ice interface in the case of ice flash program ming. when a boot loader is used , the key should be sent to the boot load code which then writes it to flsh_unlock[ 3:0 ]. flsh_unlock[ 3:0 ] is not automatically reset. it should be cleared when the spi or ice has finished changing the flash. table 40 summarizes the i/o ram registers used for flash security. table 40 : flash security name location rst wk dir description flsh_unlock[3:0] 2702[7:4] 0 0 r/w must be a 2 to enable any flash modification. see the description of flash se curity for more details. secure sfr b2[6] 0 0 r/w inhibits erasure of page 0 and flash addresses above the beginning of ce code as defined by ce_lctn[5:0 ] (i/o ram 0x2109[5:0]) . also inhibits the read of flash via the ice and spi ports. spi flash mode in normal operati on, the spi slave interface can not read or write the flash memory. however, the 71m6541d/f /g and 71m6542f/g contain a special flash m ode (sfm) that facilitates initial (production) programming of the flash memory. when the 71m654x is in sfm mode, the spi interface can erase, read, and write the flash. other memory elements such as xram and i / o ram are not ac cessible to the spi in this mode. in order to protect the flash contents, several operations are required before the sfm mode is successfully invoked. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 50 rev 5 while operating in spi flash mode (sfm), spi single - byte transactions are used to write to fl_bank[1:0] . during an spi single - byte transaction, spi_cmd[1:0] will over write the contents of fl_bank[1:0] . this will allow for access of the entire 128 kb flash memory while operating in sfm on the 71m6541g/71m6542g. if the spi port is used for code updates (in lieu of a programmer that uses the ice port), then a code that disables the flash access via spi can potentially lock out flash program updates. details on the sfm are in 2.5.10 ( spi slave port ). 2.5.1.2 mpu/ce ram the 71m6541d includes 3 kb of static ram memory on - chip (xram) plus 256 bytes of internal ram in the mpu core. the 71m6541d /f /g and the 71m6542f/g include 5 kb of static ram mem ory on - chip (xram) plus 256 bytes of internal ram in the mpu core. the static ram is used for data storage for both mpu and ce operations. 2.5.1.3 i/o ram (configuration ram) the i/o ram can be seen as a series of hardware registers that control basic hardware fu nctions. i/o ram address space starts at 0x2000. the registers of the i/o ram are listed in table 74 . the 71m6541d/f /g and 71m6542f/g include 128 by tes non - volatile ram memory on - chip in the i/o ram address space (addresses 0x2800 to 0x287f). this memory section is supported by the voltage applied at vbat_rtc and the data in it are preserved in brn , lcd, and slp modes as long as the voltage at vbat_rtc is within specification. 2.5.2 oscillator the oscillator drives a standard 32.768 khz watch crystal . this type of crystal is accurate and do es not require a high - current oscillator circuit . the oscillator has been designed specifically to handle watc h crys tals and is compatible with their high impedance and limited power handling ca pability. the oscillator power dissipation is very low to maximize the lifetime of any battery attac hed to vbat _rtc . oscillator calibration can improve the accuracy of both the rtc and metering. refer to 2.5.4 , real - time clock (rtc) for more information. the oscillator is powered from the v3p3sys pin or from the vbat _rtc pin , depending on the v3ok in ternal bit (i.e., v3ok = 1 if v3p3sys 2.8 vdc and v3ok = 0 if v3p3sys < 2.8 vdc) . the oscillator requires approximately 100 na, which is negligible compared to the internal leakage of a battery . 2.5.3 pll and internal clocks timing for the device is derived from the 32.768 khz crystal oscillator output that is multiplied by a pll by 60 0 to produce 19.660800 mhz, the master clock (mck) . all o n- chip timing , except for the rtc clock, is derived from mck. table 41 provides a summary of the clock functions and their controls . the two general - purpose counter/timers contained in the mpu are controlled by ckmpu (see 2.4.6 timers and counters ). the master clock can be boosted to 19.66 mhz by setting the pll _fast bit = 1 ( i/o ram 0x2200[4] ) and can be reduced to 6.29 mhz by pll_fast = 0. the mpu clock frequency ckmpu is determined by another divider controlled by the i/o ram control field mpu_div [2:0] (i/o ram 0x2200[2:0]) and can be set to mck* 2 -( mpu_div +2) , where mpu_div [2:0] may vary from 0 to 4 . the 71m654x v3p3sys supply current is reduced by reducing the mpu clock frequency. w hen the ice_e pin is high, t he circuit also generates the 9.8 3 mhz clock for use by the emul ator. the pll is only turned off in slp mode or in lcd mode when lcd_bste is disabled. the lcd_bste value depends on the setting of the lcd_vmode [1:0] field (see table 56 ). when the part is waking up from slp or lcd modes, the pll is turned on in 6.29 mhz mode, and the pll frequency is not be accurate until the pll_ok flag ( sfr 0xf9[4] ) rises. due to potent ial overshoot , the mpu should not change the value of pll_fast until pll_ok i s tr ue . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 51 table 41 : clock system summary clock derived from fixed frequency or range function pll_fast =1 pll_fast =0 controlled by osc crystal 32.768 khz C crystal clock mck crystal/pll 19.660800 mhz (600*ck32) 6.291456 mhz (192*ck32) pll_fast master clock ckce mck 4.9152 mhz 1.5728 mhz C ce clock ckadc mck 4.9152 mhz , 2.4576 mhz 1.572864 mhz, 0.786432 mhz adc_div adc clock ckmpu mck 4.9152 mhz 307.2 khz 1.572864 mhz 98.304 khz mpu_div [2:0] mpu clock ckice mck 9.8304 mhz 614.4 khz 3.145728 mhz 196.608 khz mpu_div[2:0] ice clock ckoptmod mck 38.40 khz 38.6 khz C optical uart modulation ck32 mck 32.768 khz C 32 khz clock 2.5.4 real - time clock (rtc) 2.5.4.1 rtc general description the rtc is driven directly by the crystal oscillator and is powered by either the v3p3sys pin or the vbat_rtc pin , depending on the v3ok internal bit . the rtc consists of a counter chain and output regis ters. the counter chain con sists of registers for seconds, minutes, hours, day of week, day of month, month, and year. the chain registers are supported by a shadow reg ister that facilitates read and write operations. table 42 shows the i/o ram registers for accessing the rtc. 2.5.4.2 accessing the rtc two bits, rtc_rd (i/o ram 0x2890[6] ) and rtc_wr (i/o ram 0x2890[7]) , control the behavior of the sha dow register. when rtc_rd is low, the shadow register is updated by the rtc after each two milliseconds. when rtc_rd is high, this update is halted and the shadow register contents become stationa ry and are suitable to be read by the mpu. thus, when the mpu wishes to read the rt c, it freeze s the shadow register by setting the rtc_rd bit, read s the shadow register, and then lower s the rtc_rd bit to let updates to the shadow register resume. since the rtc clock is only 500hz, there may be a delay of approximately 2 ms from when th e rtc_rd bit is lowered until the shadow register receives its first update. reads to rtc_rd continue to return a one until the first shadow update occurs. when rtc_wr is high, the update of the shadow register is also inhibited. during this time, the mp u may overwrite the contents of the shadow register. when rtc_wr is lowered, the shadow register is written into the rtc counter on the next 500hz rtc clock. a change bit is included for each word in the shadow register to ensure that only programmed wor ds are updated when the mpu writes a zero to rtc_wr . reads of rtc_wr return s one until the counter has actually been updated by the register. the sub - second register of the rtc, rtc_sbsc (i/o ram 0x2892) , can be read by the mpu after the one second interrupt and before reaching the next one second boundary. the rtc_sbsc register is expressed as a count of 1/128 second period s remaining until the next one second boundary. writing 0x00 to rtc_sbsc resets the counter re - start ing the count from 0 to 127. reading and resetting the sub - second counter can be used as part of an algorithm to accurately set the rtc. the rtc is capable of processing leap years . each counter has its own output register . the rtc chain registers are not affected by the reset pin, watchdog time r resets, or by transitions between the battery modes and mis sion mode. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 52 rev 5 table 42 : rtc control registers name location rst wk dir description rtc a _adj[6:0] 2504[6:0] 64 C r/w register for analog rtc frequency adjustment. rtc_p[16:14] rtc_p[13:6] rtc_p[5:0] 289b[2:0] 289c[7:0] 289d[7:2] 4 0 0 4 0 0 r/w registers for digital rtc adjustment. 0x0ffbf rtc_p 0x10040 rtc_q[1:0] 289d[1:0] 0 0 r/w register for digital rtc adjustment. rtc_rd 2890[6] 0 0 r/w freezes the rtc shadow register so it is suitable for mpu reads. when rtc_rd is read, it returns the status of the shadow register: 0 = up to date, 1 = frozen. rtc_wr 2890[7] 0 0 r/w freezes the rtc shadow register so it is suitable for mpu write operations. when rtc_wr is cleared, the contents of the shadow register written to the rtc counter on the next rtc clock (~500 hz). when rtc_wr is read, it return s 1 as long as rtc_wr is set . it continue s to return one until the rtc counter is updated. rtc_fail 2890[4] 0 0 r indicates that a count error has occurred in the rtc and that the time is not trustworthy. this bit can be cleared by writing a 0. rtc_sbsc[7:0] 2892[7:0] r time remaining since the last 1 second boundary. lsb = 1/128 second. 2.5.4.3 rtc rate control two rate adjustment mechanisms are available : ? the first rate adjustment mechanism is an analog rate adjustment, using the i/o ram register rtca_adj[6:0] (i/o ram 0x2504[6:0]) , that trims the crystal load capacitance. ? the second rate adjustment mechanism is a digital rate adjust that affects the way the clock frequency is processed in the rtc. setting rtca_adj[6:0] to 00 minimizes the load capacitance, maximizing the oscillator frequency. setting rtca_adj[6:0] to 7f maximizes the load capacitance, minimizing the oscillator frequency. the adjustable capacitance is approximately: pf adj rtca c adj 5.16 128 _ ? = the precise amount of adjustment depend s on the crystal properties , the pcb layout and the value of the external crystal capacitors . the adjustment may occur at any time, and the resulting clock frequency should be measured over a one - second interval . the second rate adjustment is digital, and can be used to adjust the clock rate up to 988ppm, with a resolution of 3.8 ppm (1.9 ppm). note that 3.8 ppm corresponds to 1 - lsb of the 19 - bit quantity formed by 4*rtcp+rtcq and 1.9 ppm corresponds to ? - lsb. t he rate adjustment is implemen ted starting at the next second - boundary fol lowing the adjustment . since the lsb results in an adjustment every four seconds, the frequency should be measured over an interval that is a multiple of four seconds. the clock rate is adjusted by writing the appropriate values to rtc_p[ 16:0] ( i/o ram 0x289b[2:0], 0x289c, 0x289d[7:2] ) and rtc_q[1:0] (i/o ram 0x289d[1:0]) . updates to rtc rate adjust registers, rtc_p and rtc_q , are done through the shadow register described above . the new values are loaded into the counters when rtc_wr (i/o ram 0x2890[7] ) is lowered. the default frequency is 32,768 rtclk cycles per second. to shift the clock frequency by d ppm, rtc_p and rtc_q are calculate d using the following equation: downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 53 ?? ? ?? ? + ?d + ? = + ? ? 5.0 10 1 8 32768 rtc_q rtc_p 4 6 floor conversely, the amount of ppm shift for a given value of 4rtc_p + rtc_q is: ? ( ??? ) = ? 32768 ? 8 4 ? ?? ? ? + ?? ? ? ? 1 ? 10 6 for example, for a shift of - 988 ppm, 4 ? rtc_p + rtc_q = 262403 = 0x40103. rtc_p = 0x10040, and rtc_q = 0x03. the default values of rtc_p and rtc_q , corresponding to zero adjustment, are 0x10000 and 0x0, respectively. two settings for the tmux 2 out test pin, pulse_1s and pulse_4s, are available for measuring and calibrating the rtc clock frequency. these are waveforms of approximately 25% duty cycle wi th 1s or 4s period. default values for rtc a _adj , rtc_p and rtc_q should be nominal values, at the center of the adjust ment range. un - calibrated extreme values (zero , for example) can cause incorrect operation. if the crystal temperature coefficient is known, the mpu can integrate temperature and correct the rtc time as necessary. alternatively, the characteristics can be loaded into an nv ram and th e osc_comp bit ( i/o ram 0x28a0[5 ]) may be set. in this case, the oscillator is adjusted automatically, even in slp mode. see the real time rtc temperature compensation section for details. 2.5.4.4 rtc temperature compensation t he 71m6541d/f /g and 71m6542f/g can be configured to regularly measure die temperature, including in slp and lcd modes and while the mpu is halted. if enabled by the osc_comp bit , th e temperature in formation is automatically used to correct for the temperature variation of the crystal . a table look - up method is used which generates t he required digital compensation without involvement from the mpu . storage for the look - up table is in a dedicated 128 byte nv ram. table 43 shows the i/o ram registers involved in automatic rtc temperature compensation. table 43 : i/o ram registers for rtc temperature compensation name location rst wk dir description osc_comp 28a0[5] 0 0 r/w enables the automatic update of rtc_p and rtc_q every time the temperature is measured. stemp[10:3] stemp[2:0] 2 881[7:0 ] 2 88 2 [7:5 ] C C r th e re s ult of the temperature measure ment ( 10 - bits of magnitude data plus a sign bit) . the complete stemp[10:0] value can be read and shifted right in a single 16 - bit read operation as shown in the following code fragment. volatile int16_t xdata stemp _at_0x2881; fa = (float)(stemp/32); lkpaddr[6:0] 2887[6:0] 0 0 r/w the address for reading and writing the rtc lookup ram . lkpautoi 2887[7] 0 0 r/w auto - increment flag. when set, lkpaddr [6:0] auto increment s every time lkp_rd or lkp_wr is pulsed. the incremented address can be read at lkpaddr [6:0] . lkpdat[7:0] 2888[7:0] 0 0 r/w the data for reading and writing the rtc lookup ram. lkp_rd lkp_wr 2889[1] 2889[0] 0 0 0 0 r/w r/w strobe bits for the rtc lookup ram read and write. when set, the lkpaddr and lkpdat registers are used in a read or write operation. when a strobe is set, it stay s set until the operation completes, at which time the strobe is cleared and lkpaddr is incremented if lkpautoi is set. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 54 rev 5 referring to figure 17 , t he table lookup method uses the 10 - bits plus sign - bit value in stemp [10:0] right - shifted by two bits to obtain an 8- bit plus sign value (i.e., nv ram address = stemp/4) . a limiter ensures th at the resulting look - up address is in the 6- bit plus sign range of - 64 to +63 (decimal). t he 8- bit nv ram content pointed to by the address is added as a 2s complement value to 0x40000, the nominal value of 4* rtc_p + rtc_q . refer to 2.5.4.3 rtc rate control for information on the rate adjustments performed by registers rtc_p [16:0] (i/o ram 0x289b[2:0], 0x289c, 0x289d[7:2] ) and rtc_q [1:0] (i/o ram 0x2891[1:0]. t he 8 - bit values loaded in to nv ram must be scaled correctly to produce rate ad justments that are consistent with the equations given in 2.5.4.3 rtc rate control for rtc_p and rtc_q . note that the sum of the 8- bit 2s complement v alue looked - up and 0x40000 for m a 19 - bit value, which is equal to 4* rtc_p + rtc_q , as shown in figure 17 . the output of the temperature compensation is automatically loaded into the rtc_p [16:0] and rtc_q [1:0] locations after each look - up and summation operation. s 0x40000 19 10+s stemp >>2 63 -64 -64 63 255 -256 limit look up ram addr 6+s 8+s q 7+s 4*rtc_p+rtc_q 19 figure 17 : automatic temperature compensation the 128 nv ram locations are organized in 2s complement format as shown in table 44 . as mentioned above, the stemp[10:0] digital temperature values are scaled such that the corresponding nv ram addresses are equal to stemp[10:0] /4 (limited in the range of - 64 to +63) . see 2.5.5 71m654x temperature sensor on page 56 for the equations to calculate temperature in degrees c from the stemp[10:0] reading. the temperature equation i s used to calculate the two temperature columns in table 44 (the second column and the rightmost column). the second column uses the full 11 - bit values of stemp[10:0] , while the values in the rightmost column are calculated using the post - limiter (6 +s) values multiplied by 4 . since each look - up table ad dress step corresponds to a 4 x 0.32 5 c temperature step, two is added to the post - limiter 6+s value after multiplying by 4 to calculate the temperature values in the right most column. this method ensure s that the compensation data is loaded into the look - up table in a manner that minimizes quantization error. table 44 shows the numerical values corresponding to each node in figure 17 . the values of stemp[10:0] outside the - 256 to +255 range are not shown in this table. the limiter output is confined to the range of - 64 to +63, which is directly the desired address of the 128 - byte look - up table. the rightmost column gives the nominal temperature corresponding to each address cell in the 128 - byte compensation table table 44 : nv ram temperature table structure stemp[10:0] (10+s) (decimal) temp ( o c) (equation) stemp[10:0]>>2 (8+s) (decimal) limit er output (6+s) (decimal) temp ( o c) ( lu table) - 256 - 61.71 - 64 - 64 - 61.06 - 255 - 61.39 - 254 - 61.06 - 253 - 60.73 -4 20.69 -1 -1 21.35 -3 21.02 -2 21.35 -1 21.67 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 55 stemp[10:0] (10+s) (decimal) temp ( o c) (equation) stemp[10:0]>>2 (8+s) (decimal) limit er output (6+s) (decimal) temp ( o c) ( lu table) 0 22.00 0 0 22.65 1 22.33 2 22.65 3 22.98 4 23.31 1 1 23.96 5 23.64 6 23.96 7 24.29 252 104.40 63 63 105.06 253 104.73 254 105.06 255 105.39 for proper operation, the mpu must load the lookup table with values that reflect the crystal properties with respect to temperature , which is typically done once during initialization . since the lookup table is not directly addressable, the mpu uses the following procedure to load the entire nv ram table: 1. set the lkpautoi bit ( i/o ram 0x2887[7] ) to enable address auto - increment . 2. w rite zero into the i/o ram register lkpaddr[6:0] ( i/o ram 0 x 2887[6:0] ). 3. w rite the 8 - bit dat um into i/o ram register lkpdat ( i/o ram 0 x 2888 ). 4. set the lkp_wr bit ( i/o ram 0 x2889[0 ] ) to write the 8- bit datum into nv_ram 5. wait for lkp_wr to clear ( lkp_wr auto - clears when the data has been copied to nv ram ). 6. repeat steps 3 through 5 until all data has been written to nv ram . the nv ram table can also be read by writing a 1 into the lkp_rd bit ( i/o ram 0x2889[1] ) . the process of reading from and writing to the nv ram is accelerated by setting the lkpautoi bit ( i/o ram 0x2887[7] ) . when lkpautoi is set, lkpaddr [6:0] auto - incremented every time lkp_rd or lkp_wr is pulsed. it is also possible to perform random access of the nv ram by writing a 0 to the lkpautoi bit and loading the desired address into lkpaddr[6:0] . if the oscillator temperature compensation feature is not being used, it is possible to use the nv ram storage area as ordinary nv storage space using the procedure described above to read and write nv ram data. in this case, keep the osc_comp bit ( i/o ram 0x28a0[5] ) rese t to disable the automatic oscillator temperature compensation feature. 2.5.4.5 rtc interrupts the rtc generates interrupts each second and each minute. these interrupts are called rtc_1sec and rtc_1min . in addition, the rtc functions as an alarm clock by generating an interrupt when the minutes and hours register s both equal their respective target count s as defined in table 45 . the alarm clock interrupt is called rtc_ t . all three interrupts appear in the mpus external interrupt 6. see table 33 in the in terrupt section for the enable bit s and flags for these interrupts. the target registers for minutes and hours are listed in table 45 . table 45 : i/o ram registers for rtc interrupts name location rst wk dir description rtc_tmin[5:0] 289e[5:0] 0 0 r/w the target minutes register. see rtc_thr[4:0] below. rtc_thr[4:0] 289f[4:0] 0 0 r/w the target hours register. the rtc_ t interrupt occur s when rtc_min becomes equal to rtc_tmin and rtc_hr becomes equal to rtc_thr . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 56 rev 5 2.5.5 71m654x temperature sensor the 71m654x includes an on - chip temperature sensor for determining the temperature of its bandgap re ference. the primary use of the temperature data is to determine the magnitude of compensation re quir ed to offset the thermal drift in the system for the com pensa tion of current, voltage and energy measurement and the rtc. s ee 4.7 metrology temperature compensation on page 97 . also see 2.5.4.4 rtc temperature compensation on page 53 . unlike earlier generation maxim socs, t he 71m 654 x does not use the adc to read the temperature sensor. instead, it uses a technique that is operation al in slp and lcd mode, as well as brn and msn modes. this means that the temperature sensor can be used to compensate for the frequency variation o f the crystal, even in slp mode while the mpu is halted. see 2.5.4.4 rtc temperature compensation on page 53 . in msn and brn modes, the temp erature sensor is awakened on command from the mpu by setting the temp_start (i/o ram 0x 28b4[6] ) control bit . the mpu must wait for the temp_start bit to clear before reading stemp[10:0] and before setting the temp_start bit once again. in slp and lcd modes, it is awakened at a regular rate set by temp_per[2:0] (i/o ram 0x28a0[2:0]) . the result of the temperature measurement can be read from the two i/o ram loc ations stemp[10:3] ( i/o ram 0x2881) and stemp[2:0] (i/o ram 0x2882[7:5] ). note that both of these i/o ram locations must be read and properly combined to form the stemp[10:0] 11 - bit value (see stemp in table 46 ). the resulting 11 - bit value is in 2s complement form and ranges from - 1024 to +1023 (decimal). the equations below are used to calculate the sensed temperature from the 11 - bit stemp[10:0] r eading. the equations below are used to calculate the sensed temperature. the first equation applies when the 71m654x is in msn mode and temp_pwr = 1. the second equation applies when the 71m654x is in brn mode, and in this case, the temp_pwr and temp_bsel bits m ust both be set to the same value, so that the battery that supplies the temperature sensor is also the battery that is measured and report ed in bsense . thus, the second equation requires reading stemp and bsense . in the second equation, bsense (the sensed battery voltage) is used to obtain a more accurate temperature reading when the ic is in brn mode. for the 71m654x in msn mode (with temp_pwr = 1): 22 325 .0 ) ( + ? = stemp c temp for the 71m654x in brn mode, (with temp_p wr = temp_b sel ): 4.64 609 .0 00218 .0 325 .0 ) ( 2 + ? ? ? + ? = bsense bsense stemp c temp o table 46 shows the i/o ram registers used for temperature and battery measurement. i f temp_pwr selects vbat_rtc when the battery is nearly discharged, the temperature measurement may not finish. in this case, firmware may complete the measurement by selecting v3p3d ( temp_pwr = 1). table 46 : i/o ram registers for temperature and battery measurement name location rst wk dir description tbyte_busy 28a0[3] 0 0 r indicates that hardware is still writing the 0x28a0 byte. additional writes to this byte are locked out while it is one. write duration could be as long as 6 ms. temp_per[2:0] 28a0[2:0] 0 C r/w sets the period between temperature measurements . auto mat ic measurements can be enabled in any mode (msn, brn, lcd, or slp). temp_per time 0 manual updates (see temp_start ) 1-6 2 ^ (3+ temp_per ) (seconds) 7 continuous downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 57 name location rst wk dir description temp_bat 28a0[4] 0 C r/w causes vbat to be measured whenever a temperature measurement is performed. temp_start 28b4[6] 0 C r/w temp_per[2:0] must be zero in order for temp_start to function. if temp_per[2:0] = 0, then setting temp_start starts a temperature measurement. ignored in slp and lcd modes. hardware clears temp_start when the temperature measurement is complete. the mpu must wait for temp_start to clear before reading stemp[10:0] and before setting temp_start again. temp_pwr 28a0[ 6] 0 C r/w selects the power source for the temp erature sensor: 1 = v3p3d, 0 = vbat_r tc. this bit is ignored in slp and lcd modes, where the temperature sensor is always powered by vbat_rtc. temp_bsel 28a0[7 ] 0 C r/w selects which battery is monitored by the temperature sensor: 1 = vbat, 0 = vbat_rtc temp_test[1:0] 2500[1:0] 0 C r/w test bits for the temperature monitor vco. temp_test must be 00 in regular operation. any other value cause s the vco to run continuously with the control voltage described below. temp_test function 00 normal operation 01 reserved for factory test 1x reserved for factory test stemp[10:3] stemp[2:0] 2881[7:0] 2882[7:5] r r the result of the temperature measurement. to correctly form stemp[10:0] , the mpu must read 0x2881[7:0], shift it left by three bit positions (padding lsbs with zeros), then read 0x2882[7:5], shift it right by 5 - bits (padding the 5 msbs with zeros), and then logically or the two quantities together. bsense[7:0] 2885[7:0] C C r the result of the battery measurement. bcurr 2704[3] 0 0 r/w connects a 100 a load to the battery selected by temp_bsel . refer to the 71m6xxx data sheet for information on reading the temperature sensor in the 71m6x01 devices. 2.5.6 71m654x battery monitor the 71m654x temperature measurement circuit can also monitor the batteries at the vbat and vbat_rtc pins. the battery to be tested (i.e., vbat or vbat_rtc pin) is selected by temp_bsel ( i/o ram 0x28a0[7] ) . when temp_bat ( i/o ram 0x28a0[4] ) is set, a battery measurement is performed as part of each temperature measurement. the value of the battery reading is stored in register bsense [7:0] (i/o ram 0x2885) . the following equation is used to calculate the voltage measured on the vbat pin ( or vbat_rtc pin) from the bsense[7:0] and stemp[10:0] values. the result of the equation below is in volts. v stemp v bsense v rtc orvbat vbat 000276 .0]0 : 10[ 0246 .0) 142 ]0:7[ ( 293 .3 ) _ ( ? + ? ? + = in msn mode, a 100 a de - passivation load can be applied to the selected battery ( i.e. , selected by the temp_bsel bit) by setting the bcurr ( i/o ram 0x2704[3] ) bit. battery imp edance can be measured by taking a battery measurement with and without bcurr . regardless of the bcurr bit setting, the battery load is never applied in brn, lcd, and slp modes. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 58 rev 5 refer to the 71m6xxx data sheet for information on reading the vcc sensor in the 71m6x01 devices. 2.5.7 uart and optical interface the 71m6541d/f /g and 71m6542f/g provide two asynchrono us interfaces, uart0 and uart1. both can be used to connect to amr modules, user interfaces, etc., and also support a mechan ism for programming the on - chip flash memory. referring to figure 19 , uart1 includes an interface to implement an ir/optical port . the pin opt_tx is designed to directly drive an external led for transmitting data on an optical link . the pin opt_rx has the same threshold as the rx pin, but can also be used to sense the input from an external photo detector used as the receiver for the optical link . opt_tx and opt_rx are connected to a dedicated uart port (uart1) . the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv (i/o ram 0x2456[0]) and opt_rxinv (i/o ram 0x2457[1]) , respectively . additionally, the opt_tx output may be modulated at 38 khz . modulation is available in msn and brn modes ( see table 67 ) . the opt_txmod bit ( i/o ram 0x2456[1] ) enables modulation . the duty cycle is controlled by opt_fdc[1:0] (i/o ram 0x2457[5:4]) , which can select 50%, 25%, 12.5%, and 6.25% duty cycle . a 6.25% duty cycle means that opt_tx is low for 6.25% of the period . when not needed for uart 1 , opt_tx can alternatively be configured as segdio51. configuration is via the opt_txe[1:0] (i/o ram 0x2456[3:2]) field and lcd_map[51] (i/o ram 0x2405[ 0 ]) . the opt_txe[1:0] field allows the mpu to select vpulse, wpulse, seg dio51 or the output of the pulse modulator to be sourced onto the opt_tx pin. likewise , the opt_rx pin can alternately be configured as seg dio55, and i ts control is o pt_rxdis (i/o ram 0x2457[2]) and lcd_map[55] (i/o ram 0x2405[4]) . b a opt_txmod = 0 opt_txmod = 1, opt_fdc = 2 (25%) b a 1/ 38 khz opt_txinv from opt_tx uart mod en duty opt_tx opt_txmod opt_fdc opt_txe[1:0] 0 2 v3p3 internal a b 1 2 3 dio2 wpulse varpulse figure 18 : optical interface bit banged optical uart (third uart) as shown in figure 19 , the 71m654 x can also be configured to drive the optical uart with a dio signal in a bit banged configuration. when control bit opt_bb ( i/o ram 0x2022[0] ) is set, the optical port is driven by dio5 and the segdio5 pin is driven by uart1_tx. this configuration is typical ly used when the two dedicated uarts must be connected to high speed clients and a slowe r optical uart is permissible. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 59 opt_txinv uart1_tx mod en duty segdio51/opt_tx opt_txmod opt_fdc opt_txe[1:0] 0 2 v3p3 internal a b opt_txmod =0 opt_txmod =1, opt_fdc =2 (25%) b a 1/38khz 1 2 3 dio51 wpulse varpulse seg51 lcd_map[51] 10 segdio55/opt_rx seg55 lcd_map[55] 10 dio55 10 opt_rxdis uart1_rx dio5 segdio5/tx2 seg5 10 lcd_map[5] opt_bb 0 0 11 figure 19 : optical interface (uart1) 2.5.8 digital i/o and lcd segment drivers 2.5.8.1 general information the 71m6541d/f /g and 71m6542f/g combine most dio pins with lcd segment drivers. e ach seg/ dio pin can be configure d as a dio pin or a s a segment (seg) driver pin . on reset or power - up, all dio pins are dio inputs (except for segdio0 - 15, see caution note below) until they are configured as desired under mpu control. the pin function can be configured by the i/o ram registers lcd_mapn (0x2405 C 0x240b) . setting the bit corresponding to the pin in lcd_mapn to 1 configures the pin for lcd, setting lcd_mapn to 0 configures it for dio. after reset or power up, pins segdio0 through seg dio15 are initially dio outputs, but are disabled by port_e = 0 (i/o ram 0x270c[5] ) to avoid unwanted pulses during reset . after configuring pins segdio0 through segdio15 the mpu must enable the se pins by setting port_e . once a pin is configured as dio, it can be configured independently as an input or output. for segdio 0 to segdio 15, this is done with the sfr registers p0 (sfr 0x80) , p1 (sfr 0x90) , p2 (sfr 0xa0) and p3 (sfr 0xb0) , as shown in table 48 (71m6541d /f/g ) and table 52 ( 71m6542f/g ). the pb pin is a dedicated digital input and is not part of the segdio system. the ce features pulse counting registers and each pulse counter interrupt output is internally rou ted to the pulse interrupt logic. thus, no routing of pulse signals to external pins is requir ed in ord er to generate pulse interrupts. see interrupt source n o. 2 in figure 16 . a 3 - bit configuration word, i/o ram register dio_rn ( i/o ram 0x2009[2:0] through 0x200e[6:4] ) can be used for pins segdio2 through segdio11 (when configured as dio) and pb to individually as sign an internal resource such as an interrupt or a timer control ( dio_rpb [2:0], i/o ram 0x2450[2:0], configures the pb pin). this way, dio pins can be tracked even if they are configured as outputs. table 47 lists t he internal resources which can be assigned using dio_r2 [2:0] through dio_r11 [2:0] and dio_rpb [2:0] . if more than one input is connected to the same resource, the resources are combined using a logical or. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 60 rev 5 table 47 : selectable resources using the dio_rn [2:0] bits value in dio_rn [2:0] resource selected for segdion or pb pin 0 none 1 reserved 2 t0 (counter0 clock) 3 t1 (counter1 clock) 4 high priority i/o interrupt (int0) 5 low priority i/o interrupt (int1) note: resources are selectable only on segdio2 through segdio11 and the pb pin. see table 48 (71m6541d/f /g ) and table 52 ( 71m6542f/g ). when driving leds, relay coils etc., the dio pins should sink the current into gndd (as shown in figure 20 , right), not source it from v3p3d (as shown in figure 20 , left). this is due to the resistance of the internal switch that connects v3p3d to either v3p3sys or vbat. see 6.4.6 v3p3d s witch on page 144 . sourcing current in or out of dio pins other than those dedicated for wake funct ions, for ex ample with pull - up or pull - down resistors, must be avoided. violating this rule lead s to increased quiescent current in sleep and lcd modes. figure 20 : connecting an external load to dio pins v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z not recommended recommended downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 61 2.5.8.2 digital i/o for the 71m6541d/f /g a total of 3 2 combined seg/ dio pins plus 5 seg outputs are available for the 71m6541d/f /g . these pins can be categorized as follows: 17 combined seg/dio segment pins: o segdio4segdio5 (2 pins) o segdio 9 segdio14 ( 6 pins) o segdio19segdio2 5 (7 pin s) o segdio44segdio45 (2 pins) 15 combined seg / dio segment pins shared with other functions: o segdio0/wpulse, segdio1/vpulse (2 pins) o segdio2/sdck, segdio3/sdata (2 pins) o segdio6/xpulse, segdio7/ypulse (2 pins) o segdio8/di (1 pin) o segdio26/com5, segdio27/com4 (2 pins) o segdio36/spi_cszsegdio39/spi_cki (4 pins) o segdio51/opt_tx, segdio55/opt_rx (2 pins) 5 dedicated seg segment pins are available: o ice inteface pins: seg48/e_rxtx, seg49/e_tclk, seg50/ e_rst (3 pins) o test port pins: seg46/tmux2out, seg47/tmuxout (2 pins) there are f our dedicated common segment outputs (com0com3) plus the two additional shared common segment outputs that are listed under combined seg / dio shared pins (segdio26/com5, segdio27/com4) . thus, in a configuration where none of these pins are used as dios, there can be up to 37 lcd segment pins with 4 commons, or 35 lcd segment pins with 6 commons. and in a configuration where lcd segment pins are not used, there can be up to 32 dio pins. the configuration for pins segdio 19 to segdio 27 is shown in table 49 , and the configuration for pins segdio 36- 39 and segdio 44- 45 is shown in table 50 . seg46 to seg50 cannot be configured for dio. the configuration for pins segdio 51 and segdio 55 is shown in table 51 . table 48 : data/direction registers for segdio0 to segdio1 4 (71m6541d/f /g ) segdio 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pin # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 C configuration: 0 = dio, 1 = lcd 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 C lcd_map[7:0] (i/o ram 0x240b) lcd_map[1 4 :8] (i/o ram 0x240a) seg data register 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 C lcd_seg0[5:0] to lcd_seg1 4 [5:0] (i/o ram 0x2410[5:0] to 0x241 e [5:0] dio data register 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 C p0 ( sfr 0x80 ) p1 ( sfr 0x90 ) p2 ( sfr 0xa0 ) p3 ( sfr 0xb0 ) direction re gister: 0 = input, 1 = output 4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 C p0 ( sfr 0x80 ) p1 ( sfr 0x90 ) p2 ( sfr 0xa0 ) p3 ( sfr 0xb0 ) internal re sources configurable (see table 47 ) C C y y y y y y y y y y C C C C downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 62 rev 5 table 49 : data/direction registers for segdio 19 to segdio 27 (71m6541d/f /g ) segdio C C C 19 20 21 22 23 24 25 26 27 C C C C pin # C C C 16 15 14 13 12 11 10 9 8 C C C C configuration: 0 = dio, 1 = lcd C C C 3 4 5 6 7 0 1 2 3 C C C C lcd_map[23:1 9] (i/o ram 0x2409) lcd_map[ 27:24] (i/o ram 0x2408) seg data register C C C 19 20 21 22 23 24 25 26 27 C C C C lcd_segdio1 9 [5:0] to lcd_segdio 27 [5:0] (i/o ram 0x242 3 [5:0] to 0x242 c [5:0]) dio data register C C C 19 20 21 22 23 24 25 26 27 C C C C lcd_segdio1 9 [0] to lcd_segdio 27 [0] (i/o ram 0x242 3 [0] to 0x242 c [0]) direction re gister: 0 = input, 1 = output C C C 19 20 21 22 23 24 25 26 27 C C C C lcd_segdio1 9 [1] to lcd_segdio 27 [1] (i/o ram 0x242 3 [1] to 0x24 2c [1]) table 50 : data/direction registers for segdio3 6- 39 to segdio4 4- 45 (71m6541d/f /g ) segdio C C C C 36 37 38 39 C C C C 44 45 pin # C C C C 3 2 1 64 C C C C 63 62 configuration: 0 = dio, 1 = lcd C C C C 4 5 6 7 C C C C 4 5 lcd_map[39:3 6] (i/o ram 0x2407) lcd_map[45:4 4] (i/o ram 0x2406) seg data register C C C C 36 37 38 39 C C C C 44 45 lcd_segdio3 6 [5:0] to lcd_segdio45[5:0] (i/o ram 0x243 4- 2437 [5:0] to 0x243 c- 243d [5:0]) dio data register C C C C 36 37 38 39 C C C C 44 45 lcd_segdio32[0] to lcd_segdio45[0] (i/o ram 0x243 4- 2437 [0] to 0x 243c - 243d[0]) direction re gister: 0 = input, 1 = output C C C C 36 37 38 39 C C C C 44 45 lcd_segdio32[1] to lcd_segdio45[1] (i/o ram 0x243 4- 2437 [1] to 0x243 c- 243d [1]) table 51 : data/direction registers for segdio51 and segdio55 (71m6541d/ f /g ) segdio 51 C C C 55 C C C pin # 33 C C C 32 C C C configuration: 0 = dio, 1 = lcd 3 C C C 7 C C C lcd_map[55] , ldc_map[51] (i/o ram 0x2405) seg data register 51 C C C 55 C C C lcd_segdio51[5:0] , lcd_segdio55[5:0] (i/o ram 0x2443[5:0] and 0x2447[5:0]) dio data register 51 C C C 55 C C C lcd_segdio51[0] to lcd_segdio55[0] (i/o ram 0x2443[0] and 0x2447[0]) direction re gister: 0 = input, 1 = output 51 C C C 55 C C C lcd_segdio51[1] to lcd_segdio55[1] (i/o ram 0x2443[1] and 0x2447[1]) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 63 2.5.8.3 digital i/o for the 71m6542f/g a total of 5 5 combined seg/ dio pins are available for the 71m654 2 d/f . the se pins can be categorized as follows: 36 c ombined dio/lcd segment pins : o segdio 4 segdio5 ( 2 pins) o segdio 9 segdio 2 5 ( 17 pins) o segdio 28 segdio 35 (8 pins) o segdio 40 segdio 45 (6 pins) o segdio52segdio5 4 (3 pins) 15 combined dio/lcd segment pins shared with other functions : o segdio0/wpulse, segdio1/vpulse (2 pins) o segdio2/sdck, segdio3/sdata (2 pins) o segdio6/xpulse, segdio7/ypulse (2 pins) o segdio8/di (1 pin) o segdio26/com5, segdio27/com4 (2 pins) o segdio36/spi_cszsegdio39/spi_cki (4 pins) o segdio51/opt_tx, segdio55/opt_rx (2 pins) 5 dedicated seg segment pins are available: o ice inteface pins: seg48/e_rxtx, seg49/e_tclk, seg50/ e_rst (3 pins) o test port pins: seg46/tmux2out, seg47/tmuxout (2 pins) there are four dedicated common segment outputs (com0com3) plus the two addi tional shared common segment outputs that are listed under combined seg/dio shared pins (segdio26/com5, segdio27/com4). thus, in a configuration where none of these pins are used as dios, there can be up to 55 lcd segment pins with 4 commons, or 54 lcd segment pins with 6 commons. and in a configuration where lcd segment pins are not used, there can be up to 50 dio pins. example: segdio12 ( see pin 32 in table 52 ) is configured as a dio output pin with a value of 1 (high) by writing 0 to bit 4 of lcd_map[ 15:8 ] , and wri ting 1 to both p3[4] and p3[0] . the same pin is configured as an lcd driver by wri ting 1 to bit 4 of lcd_map[ 15:8 ] . the display information is written to bits 0 to 5 of lcd_seg12. the configuration for pins seg dio 16 to seg dio31 is shown in table 53 , the configuration for pins seg dio 32 to seg dio 45 is shown in table 54 . seg46 through seg50 cannot be configured as dio pins. the configuration for pins seg dio 51 to seg dio 55 is shown in table 55 . table 52 : data/direction registers for seg dio 0 to segdio15 ( 71m6542f/g ) seg dio 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pin # 45 44 43 42 41 39 38 37 36 35 34 33 32 31 30 29 configuration : 0 = dio , 1 = lcd 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 lcd_map[7:0] (i/o ram 0x240b) lcd_map[15:8] (i/o ram 0x240a) seg data register 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lcd_seg 0 [5:0] to lcd_seg15[5:0] (i/o ram 0x2410[5:0] to 0x241f[5:0] dio data register 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 p0 ( sfr 0x 80 ) p1 (sfr 0x 90) p2 ( sfr 0x a0 ) p3 ( sfr 0x b0 ) direction re gister: 0 = input, 1 = output 4 5 6 7 4 5 6 7 4 5 6 7 4 5 6 7 p0 ( sfr 0x 80 ) p1 ( sfr 0x 0 ) p2 ( sfr 0x a0 ) p3 ( sfr 0x b0 ) internal re sources configurable (see table 47 ) C C y y y y y y y y y y C C C C downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 64 rev 5 table 53 : data/direction registers for segdi o16 to segdio31 ( 71m6542f/g ) seg dio 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 pin # 28 27 25 24 23 22 21 20 19 18 17 16 11 10 9 8 configuration : 0 = dio , 1 = lcd 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 lcd_map[23:16] (i/o ram 0x2409) lcd_map[31:24] (i/o ram 0x2408) seg data register 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 lcd_segdio16[5:0 ] to lcd_segdio31[5:0] (i/o ram 0x2420[5:0] to 0x242f[5:0]) dio data register 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 lcd_segdio16[0 ] to lcd_segdio31[0] (i/o ram 0x2420[0] to 0x242f[0]) direction re gister : 0 = input, 1 = output 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 lcd_segdio16[1] to lcd_segdio31[1] (i/o ram 0x2420[1] to 0x242f[1]) table 54 : data/direction registers for segdio32 to segdio45 ( 71m6542f/g ) segdio 32 33 34 35 36 37 38 39 40 41 42 43 44 45 pin # 7 6 5 4 3 2 1 100 99 98 97 96 95 94 configuration: 0 = dio, 1 = lcd 0 1 2 3 4 5 6 7 0 1 2 3 4 5 lcd_map[39:32] (i/o ram 0x2407) lcd_map[45:40] (i/o ram 0x2406[5:0]) seg data register 32 33 34 35 36 37 38 39 40 41 42 43 44 45 lcd_segdio32[5:0] to lcd_segdio45[5:0] (i/o ram 0x2430[5:0] to 0x243d[5:0]) dio data register 32 33 34 35 36 37 38 39 40 41 42 43 44 45 lcd_segdio32[0] to lcd_segdio45[0] (i/o ram 0x2430[0] to 0x243d[0]) direction re gister: 0 = input, 1 = output 32 33 34 35 36 37 38 39 40 41 42 43 44 45 lcd_segdio32[1] to lcd_segdio45[1] (i/o ram 0x2430[1] to 0x243d[1]) table 55 : data/direction registers for segdio51 to segdio55 ( 71m6542f/g ) segdio 51 52 53 54 55 C C C pin # 53 52 51 47 46 C C C configuration: 0 = dio, 1 = lcd 0 1 2 3 4 C C C lcd_map[55: 51 ] (i/o ram 0x2405 [7:3] ) seg data register 51 52 53 54 55 C C C lcd_segdio51[5:0] to lcd_segdio55[5:0] (i/o ram 0x2443[5:0] to 0x2447[5:0]) dio data register 51 52 53 54 55 C C C lcd_segdio51[0] to lcd_segdio55[0] (i/o ram 0x2443[0] to 0x2447[0]) direction re gister: 0 = input, 1 = output 51 52 53 54 55 C C C lcd_segdio51[1] to lcd_segdio55[1] (i/o ram 0x2443[1] to 0x2447[1]) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 65 2.5.8.4 lcd drivers the lcd drivers are grouped into up to six co mmons (com0 C com5) and up to 56 segment drivers . the lcd interface is flexible and can drive 7 - segment digits, 14 - segments digits or enunciator symbols. a voltage doubler and a contrast dac generate vlcd from either vbat or v3p3sys, depending on t he v3p3sys voltage. the voltage doubler, while capable of driving into a 500 k load , is able to generate a maximum lcd voltage that is within 1 v of tw ice the supply voltage . the doubler and dac operate from a trimmed low - power reference . t he configuration of the vlcd generation is controlled by the i/o ram field lcd_vmode[1:0] (i/o ram 0x2401[7:6]) . it is decoded into the lcd_ext , ldac_e , and lcd_bst e internal signals. table 56 details the lcd_ v mode[1:0] configurations. table 56 : lcd_vmode [1:0] configurations lcd_vmode [1:0] lcd_ext ldac_e lcd_bste description 11 1 0 0 external vlcd connected to the vlcd pin. 10 0 1 1 see note 2 below for the definition of v3p3l. lcd boost is enabled. the maximum vlcd pin vol tage is 2*v3p3l - 1. in general, the vlcd pin voltage is as follows: vlcd = max(2*v3p3l - 1, 2.5(1+ lcd_dac[4:0] / 31) 01 0 1 0 lcd boost is disabled. the maximum vlcd voltage is v3p3l . vlcd = max(v3p3l, 2.5v+2.5* lcd_dac[4:0] /31) 00 0 0 0 vlcd=v3p3l, lcd dac and lcd boost are disabled. in lcd mode, this setting causes the lowest battery current. note s: 1. lcd_ext, ldac_e and lcd_bste are 71m654x internal signals which are deco ded from the lcd_vmode[1:0] control field setting ( i/o ram 0x2 401 [ 7:6] ). each of these decoded signal s , when asserted, has the effect indicated in the description column above, and as summarized below. lcd_ext : when set, the vlcd pin expects an external supply voltage ldac_e : when set, lcd dac is enabled lcd_bste : when set, the lcd boost circuit is enabled 2. v3p 3l is an internal supply rail that is supplied from either the vbat pin or the v3p3sys pin , depending on the v3p3sys pin voltage. when the v3p3sys pin drops below 3.0 vdc, the 71m654x switches to brn mode and v3p3l is source d from the vbat pin, otherwise v 3p3l is sourced from the v3p3sys pin while in msn mode. when using the vlcd boost circuit, use care when setting the lcd_dac[4:0] ( i/o ram 0x240d[4:0] ) value to ensure that the lcd manufacturers recommended operating voltage specification is not exceeded. the voltage doubler is active in all lcd modes including the lcd mode when lcd_bste = 1. current dissipation in lcd mode can be reduced if the boost circuit is disabled and the lcd system is oper ated directly from vbat. the lcd dac uses a low - power reference and, within the constraints of vbat and the voltage doubler, generate s a vlcd voltage of 2.5 vdc + 2.5 * lcd_dac[4:0 ] /31. the lcd_bat bit ( i/o ram 0x2402[7] ) causes the lcd system to use the battery voltage in all power modes. this may be use ful when an external supply is available for the lcd system. the advantage of connecting the external supply to vbat, rather than vlcd is that the lcd dac is still active. if lcd_ext = 1, the vlcd pin must be driven from an external source. in this case, the lcd dac ha s no effect. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 66 rev 5 the lcd system has the ability to drive up to six segments per seg driver. if the display is configured with six back planes, the 6 - way multiplexing compress es the number of seg pins required to drive a display and therefore enhance the number of dio pins available to the application. refer to the lcd_mode[2:0] field (i/o ram 0x2400[6:4]) settings ( table 57 ) fo r the different lcd multiplexing choices. if 5 - state multip lexing is selected, segdio27 is converted to com4. if 6 - state multiplexing is selected, segdio26 i s converted to com5. these conversions override the seg/dio mapping of segdio 26 and segdio27. a dditionally, independent of lcd_mode[2:0], if lcd_allcom = 1, then segdio26 and segdio27 be come com4 and com5 if their lcd_map[ ] bits are set. the lcd_on ( i/o ram 0x240c[0 ]) and lcd_blank ( i/o ram 0x240c[1] ) bits are an easy way to either blank the lcd display or turn it fully on. neither bit affect s the contents of the lcd data stored in the lcdseg_dio[ ] registers. in comparison, lcd_rst ( i/o ram 0x240c[2] ) clears all lcd data to zero. lcd_rst affects only pins that are configured as lcd. a small amount of power can be saved by programming the lcd frequency to the lowest value that provides satisfactory lcd visibility over the required temperature range. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 67 table 57 shows all i/o ram registers that control the operation of the lcd interface. table 57 : lcd configurations name location rst wk dir description lcd_allcom 2400[3] 0 C r/w configures all 6 seg/com pins as com. has no effect on pins whose lcd_map bit is zero. lcd_bat 2402[7] 0 C r/w connects the lcd power supply to vbat in all modes. lcd_e 2400[7] 0 C r/w enables the lcd display. when disabled, vlc2, vlc1, and vlc0 are ground as are the com and seg outputs if their lcd_map bit is 1. lcd_on lcd_blank 240c[0] 240c[1] 0 0 C r/w r/w lcd_on = 1 turns on all lcd segments without affecting the lcd data. similarly, lcd_blank = 1 turns off all lcd segments without affecting the lcd data. if both bits are set, all lcd segments are turned on . lcd_rst 240c[2] 0 C r/w clear all bits of lcd data. these bits affect segdio pins that are configured as lcd drivers. lcd_dac[4:0] 240d[4:0] 0 C r/w this register controls the lcd contrast dac , which adjusts the vlcd voltage and has an output range of 2.5 vdc to 5 vdc. the vlcd voltage is vlcd = 2.5 + 2.5 * lcd_dac[4:0] /31 thus, the lsb of the dac is 80.6 mv. the maximum dac output voltage is limited by v3p3sys, vbat, and whether lcd_bste is set. lcd_clk[1:0] 2400[1:0] 0 C r/w sets the lcd clock frequency (1/t). see definition of t in figure 21 . note: fw = 32768 hz 00 - fw/2^9, 01 - fw/2^8, 10 - fw/2^7, 11 - fw/2^6 lcd_mode[2:0] 2400[6:4] 0 C r/w the lcd bias and multiplex mode. lcd_mode output 000 4 states, 1/3 bias 001 3 states, 1/3 bias 010 2 states, ? bias 011 3 states, ? bias 100 static display 101 5 states, 1/3 bias 110 6 states, 1/3 bias lcd_vmode[1:0] 2401[7:6] 00 00 r/w this register specifies how vlcd is generated. lcd_vmode description 11 external vlcd 10 lcd boost and lcd dac enabled 01 lcd dac enabled 00 no boost and no dac. vlcd = vbat or v3p3sys the lcd can be driven in static, ? bias, and 1/3 bias modes. figure 21 defines the com waveforms. note that com pins that are not required in a specific mode maintain a segment off state rather than gnd, vcc, or high impedance. the segment driver s segdio 22 and segdio23 can be configured to blink at either 0.5 hz or 1 hz. the blink rate is con trolled by lcd_y (i/o ram 0x2400[2]) . there can be up to six pixels/segments connected to each of these driver pin s . t he i/o ram fields lcd_blkmap 22 [5 :0] (i/o ram 0x2402[5:0]) and lcd_blkmap 23 [5 :0] (i/o ram 0x2401[5:0]) i dentif y which pixels, if any, are to blink. lcd_blkmap22[5:0] and lcd_blkmap23[5:0] are non - volatile. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 68 rev 5 the lcd bias may be compensated for temperature using the lcd_dac [4:0] field ( i/o ram 0x240d[4:0 ]). the bias may be adjusted from 1.4 v below the 3.3 v supply (v3p3sys in msn mode and vbat in brn and lcd mode s ). when the lcd_dac [4:0] field is set to 000, the dac is bypassed and powered down. this can be used to reduce current in lcd mode. static (lcd_mode=100) com0 com1 com2 com3 com4 com5 seg_on seg_off (1/2) (1/2) (1/2) (1/2) (1/2) 1/2 bias, 2 states (lcd_mode = 010 ) com0 com1 com2 com3 com4 com5 seg_on seg_off (1/2) (1/2) (1/2) (1/2) 0 1 1/2 bias, 3 states (lcd_mode = 011 ) com0 com1 com2 com3 com4 com5 seg_on seg_off (1/2) (1/2) (1/2) 0 1 2 1/3 bias, 3 states (lcd_mode = 011 ) com0 com1 com2 com3 com4 com5 seg_on seg_off (2/3) 0 1 2 (1/3) 1/3 bias, 4 states (lcd_mode = 000 ) com0 com1 com2 com3 com4 com5 seg_on seg_off 0 1 2 1/3 bias, 6 states (lcd_mode = 110 ) com0 com1 com2 com3 com4 com5 seg_on seg_off 0 1 2 3 3 4 5 t figure 21 : lcd waveforms downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 69 lcd drivers (71m6541d/f /g ) with a maximum of 35 lcd driver pins available , the 71m6541d/f /g is capable of driving up to 6 x 35 = 210 pixels of an lcd display when using the 6 x multiplex mode. at eight pixels per digit, this corresponds to 26 digits. lcd segment data is written to the lcd_ segn[5:0] i/o ram registers as described in 2.5.8.2 and 2.5.8.3 . seg46 through seg50 cannot be configured as dio pins. display data for these pins are written to i/o ram registers lcd_seg46[5:0] through lcd_seg50[5:0] (see table 58 ). when the ice_e pin is pulled high , it overrides the seg functionality , and pins e_rxtx/seg48, e_tclk/seg49 and e_rst/seg50 function as ice interface pins . lcd_map[46] and lcd_map[47] (i/o ram 0x2406[6] and 0x2407[7]) must be set to 1 in order to permit tmux2out/seg46 and tmuxout/seg47 to operate as seg drivers , otherwise. if lcd_map[46] and lcd_map[47] are 0, these pins operate as tmu2xout and tmuxout (see 2.5.12 test ports (tmuxout and tmux2out p in s) on page 78 ). table 58 : 71m6541d/f /g lcd data registers for seg46 to seg 50 seg 46 47 48 49 50 pin # 61 60 38 37 36 configuration always lcd pins, except when used for ice inter face or tmuxout/tmux2out. seg data register lcd_seg46[5:0] lcd_seg47[5:0] lcd_seg48[5:0] lcd_seg49[5:0] lcd_seg50[5:0] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 70 rev 5 lcd drivers ( 71m6542f/g ) with a maximum of 56 lcd driver pins available , the 71m6542d/f is capable of driving up to 6 x 56 = 336 pixels of an lcd display when using the 6 x multiplex mode. at eight pixels per digit, this corresponds to 42 digits. lcd segment data is written to the lcd_ segn[5:0] i/o ram registers as described in 2.5.8.3 digital i/o for the . seg46 through seg50 cannot be configured as dio pins. display d ata for these pins are written to i/o ram fields lcd_seg46[5:0] ( i/o ram 0x243e[5:0] ) through lcd_seg50[5:0] ( i/o ram 0x2442[5:0] ); see table 59 . the associated pins function as ice interface pins, and the ice functionality overrides the lcd function whenever ice_e is pulled high. table 59 : 71m6542f/g lcd dat a registers for seg46 to seg50 seg 46 47 48 49 50 pin # 93 92 58 57 56 configuration: always lcd pins , except when used for ice inter face or tmuxout/tmux2out. seg data register lcd_segdio46[5:0] lcd_segdio47[5:0] lcd_segdio48[5:0] lcd_segdio49[5:0] lcd_segdio50[5:0] 2.5.9 eeprom interface the 71m6541d/f /g provides hardware support for either a two - pin or a three - wire ( - wire) type of eeprom interfa ce. the interfaces use the sfr eectrl ( sfr 0x9f ) and eedata (sfr 0x9e) registers for commu nication . 2.5.9.1 two -p in eeprom interface the dedicated 2 - pin serial interface communicates with external eeprom devices and is intended for use with i 2 c devices . the interface is mul tiplexed onto the segdio2 ( sdck ) and segdio3 ( sdata ) pins and is selected by setting dio_eex [ 1:0] = 01 ( i/o ram 0x2456[7:6] ) . the mpu communicates with the interface through the sfr registers eedata and eectrl . if the mpu wishes to write a byte of data to the eeprom, it places the data in eedata and then writes the transmit code to eectrl . this initiates the transmit operation which is finished when the busy bit falls . int5 is also asserted when busy falls . the mpu can then check the rx_ack bit to see if the eeprom acknowledged the trans - mission. a byte is read by writing the receive command to eectrl and waiting for the busy bit to fall . upon completion, the received data is in eedata . the serial transmit and receive clock is 78 khz during each transmission, and then holds in a high state until the next transmission . the eectrl bits when the two - pin interface is selected are shown in table 60 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 71 table 60 : eectrl bits for 2 - pin interface status bit name read/ write reset state polarity description 7 error r 0 positive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 positive 1 indicates that the eeprom sent an ack bit. 4 tx_ack r 1 positive 1 indicates that an ack bit has been sent to the eeprom . 3:0 cmd[3:0] w 0000 positive cmd[3:0] operation 0000 no - op command. 0010 receive a byte from the eeprom and send ack. 0011 transmit a byte to the eeprom. 0101 issue a stop sequence. 0110 receive the last byte from the eeprom and do not send ack. 1001 issue a start sequence. others no operation, set the error bit. the eeprom interface can also be operated by controlling the dio 2 and dio 3 pins directly. the direction of the dio line can be changed from input to output and an output value can be written with a single write operation, thus avoiding collisions (see table 15 port registers (segdio0 - 15) ). therefore, no resistor is required in series sdata to protect against c ollisions . 2.5.9.2 three -w ire ( - wire) eeprom interface with single data pin a 500 khz three - wire interface, using sdata, sdck , and a dio pin for cs is available . the interface is selected by setting dio_eex [1:0] = 10 . the eectrl bits when the three - wire interface is selected are shown in table 61 . when eectrl is written, up to 8 bits from eedata are either written to the eeprom or read from the eeprom, depending on the values of the eectrl bits. 2.5.9.3 three -w ire ( - wire/spi ) eeprom interface with separate di/do pins if dio_eex[1:0]= 11 , the three - wire interface is the same as above, except di and do are separate pins. in this case, segdio3 becomes do and segdio 8 becomes di. the timing diagrams are the same as for dio_eex [1:0] = 10 except that all output data appears on do and all input data is expected on di. in this mode, di is ignored while data is being received on do. this mode is compatible wit h spi modes 0,0 and 1,1 where data is shifted out on the falling edge of the clock and is strobed in on the rising edge of the clock. table 61 : eectrl bits for the 3 -w ire interface control bit name read/ write description 7 wfr w wait for ready . if this bit is set, the trailing edge of busy is de layed until a rising edge is seen on the data line . this bit can be used during the last byte of a write command to cause the int5 interrupt to occur when the eeprom has finished its int ernal write sequence . this bit is ignored if hi -z =0. 6 busy r asserted while the serial data bus is busy . when the busy bit falls, an int5 interrupt occurs. 5 hiz w indicates that the sd signal is to be floated to high impedance immedi ately after the last sdck rising edge. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 72 rev 5 control bit name read/ write description 4 rd w indicates that eedata ( sfr 0x9e ) is to be filled with data from eeprom. 3 :0 cnt[3:0] w specifies the number of clocks to be issued . allowed values are 0 through 8 . if rd=1, cnt bits of data are read msb first, and right justified into the low order bits of eedata . if rd=0, cnt bits are sent msb first to the eeprom, shifted out of the msb of eedata . if cnt[3:0] is zero, sdata simply obey s the hiz bit. the timing diagrams in figure 22 through figure 26 describe the 3 - wire eeprom interface behavior . all commands begin when the eectrl ( sfr 0x9f ) register is written . transactions start by first raising the dio pin that is connected to cs . multiple 8 - bit or less commands such as those shown in figure 22 through figure 26 are then sent via eectrl and eedata . when the transaction is finished, cs must be lowered . a t the end of a read transaction, the eeprom is driving sdata, but transition s to hi - z (high impedance) when cs falls . the firmware should then immediately issue a write command with cnt=0 and hiz=0 to take control of sdata and force i t to a low - z state. figure 22 : 3 -w ire interface . write command, hiz=0. figure 23 : 3 -w ire interface . write command, hiz=1 figure 24 : 3 -w ire interface . read command. sclk (output) busy (bit) cnt cycles (6 shown) sdata (output) write -- no hiz d2 d3 d4 d5 d6 d7 eectrl byte written int5 sdata output z (loz) cnt cycles (6 shown) write -- with hiz int5 eectrl byte written sclk (output) busy (bit) sdata (output) d2 d3 d4 d5 d6 d7 (hiz) (loz) sdata output z cnt cycles (8 shown) read d0 d1 d2 d3 d4 d5 int5 d6 d7 eectrl byte written sclk (output) busy (bit) sdata (input) sdata output z (hiz) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 73 figure 25 : 3 - wire interface . write command when cnt=0 figure 26 : 3 -w ire interface . write command when hiz=1 and wfr=1. 2.5.10 spi slave port the slave spi port communicates directly with the mpu data bus and is able to read and wr ite data ram and i /o ram locations . it is also able to send commands to the mpu . the interface to the slave port consists of the sp i_ csz, sp i_c ki , s pi_ di and sp i_ do pins . these pins are multi plexed with the combined dio/lcd segment driver pins seg dio 36 to seg dio39 . additionally, the spi interface allows flash memory to be read and to be programmed. to facilitate flash programming, cycling power or asserting reset causes the spi port pins to default to spi mode. the spi port is disabled by clearing the spi_e bit ( i /o ram 0x270c[4] ) . possible applications for the spi interface are: 1) an external host reads data from ce locations to obtain metering information. this can be used in applications where the 71m654x function as a smart front - end with preprocessing capability. since the addresses are in 16 - bit format, any type of xram data can be accessed: ce, mpu, i/o ram, but not sfrs or the 80515 - internal register bank. 2) a communication link can be established via the spi interface: by writing into mpu memory locations, the external host can initiate and control processes in the 71m654x mpu. writing to a ce or mpu location normally generates an interrupt, a function that can be used to signal to the mpu that the byte that had just been written by the external host must be read and processed. data can also be inserted by the external host without generating an interrupt. 3) an external dsp can access front - end data generated by the adc. this mode of operation uses t he 71m654x as an analog front - end (afe). 4) flash programming by the external host (spi flash mode) . s pi transactions a typical spi transaction is as follows. while spi_csz is high, the port i s held in an initialized/reset state. during this state, spi_do is held in hi -z state and all transitions on spi_clk and spi_di are ignored. when spi_csz falls, the port begin s the transaction on the first rising edge of spi_clk. as shown in table 62 , a transaction consists of an optional 16 bit address, an 8 bit command, an 8 bit status byte, followed by one or more bytes of data. the transaction ends when spi_csz is raised. some transact ions may consist of a command only. cnt cycles (0 shown) write -- no hiz d7 int5 not issued cnt cycles (0 shown) write -- hiz int5 not issued eectrl byte written eectrl byte written sclk (output) busy (bit) sdata (output) sclk (output) busy (bit) sdata (output) (hiz) sdata output z sdata output z (loz) cnt cycles (6 shown) write -- with hiz and wfr eectrl byte written sclk (output) busy (bit) sdata (out/in) d2 d3 d4 d5 d6 d7 busy ready (from eeprom) int5 (from 654x) sdata output z (hiz) (loz) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 74 rev 5 when spi_csz rises, spi command bytes that are not of the form x000 000 0 update the spi_cmd (sfr 0xfd) register and then cause an interrupt to be issued to the mpu. the exception is if the transaction was a single byte. in this case, the spi_cmd byte is always updated and the interrupt issued. spi_cmd is not cleared when spi_csz is high. the spi port supports data transfers up to 10 mb/s. a serial read or write operation requires at least 8 clocks per byte, guaranteeing spi access to the ram is no faster than 1.25 mhz, thus ensuring that spi access to dram is always possible. table 62 : spi transaction fields field name required size (bytes) description address yes, except for single - byte transaction 2 16 - bit address. the address field is not required if the trans action is a simple spi command . command yes 1 8- bit command . this byte can be used as a command to the mpu. in multi - byte transactions, the msb is the r/w bit. unless the transaction is multi - byte and spi_ cmd is exactly 0x80 or 0x00, the spi_cmd register is updated and an spi interrupt is issued. otherwise, the spi_cmd register is un changed and the interrupt is not issued. s tatus yes, if transaction includes data 1 8- bit status field, indicating the status of the previous trans action. this byte is also available in the mpu memory map as spi_stat (i/o ram 0x2708) register . see table 64 for the contents. d ata yes, if transaction includes data 1 or more the read or write data. address is auto incremented for each new byte. the spi_stat byte is output on every spi transaction and indicates the parity of the previous transac tion and the error status of the previous transaction. potential error s ources are: ? 71m654x not ready . ? t ransaction not ending on a byte boundary. spi safe mode somet imes it is desirable to prevent the spi interface from writing to arbitrary ram l ocations and thus disturbing mpu and ce operation. this is especially true in afe applications. for t his reason, the spi safe mode was created. in spi safe mode, spi write operations are disabled ex cept for a 16 byte transfer region at address 0x400 to 0x40f. if the spi host needs to write to other addresses, it must use the spi_cmd register to request the write operation from the mpu. spi safe mode is enabled by the spi_s afe bit ( i/o ram 0x270c[3] ). single - byte transaction if a transaction is a single byte, the byte is interpreted as spi_cmd. regardless of the byte value, single - byte transactions always update the spi_cmd register and cause an spi interrupt to be generated. multi - byte transaction as shown in figure 27 , multi - byte operations consist of a 16 bit address field, an 8 bit cmd, a status byte, and a sequence of data bytes. a multi byte transaction is three or more bytes. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 75 a15 a14 a1 a0 c0 0 31 x d6 d1 d0 d7 d6 d1 d0 c5 c6 c7 (from host) spi_csz (from host) spi_ck (from host) spi_di (from 6543) spi_do 8 bit cmd 16 bit address data[addr] data[addr+1] 15 16 23 24 32 39 extended read . . . serial read a15 a14 a1 a0 c0 c5 c6 c7 x 8 bit cmd 16 bit address data[addr] data[addr+1] extended write . . . serial write d6 d1 d0 d7 d6 d1 d0 x hi z hi z status byte st7 st6 st5 st0 d7 40 47 0 31 15 16 23 24 32 39 40 47 status byte d7 st7 st6 st5 st0 (from host) spi_csz (from host) spi_ck (from host) spi_di (from 6543) spi_do figure 27 : spi slave port - typical multi - byte r ead and w rite o perations table 63 : spi c ommand sequence s c ommand sequence d escription addr 1xxx xxxx status byte0 ... byten read data starting at addr. addr auto - increment s until spi_csz is raised. upon completion, spi_cmd (sfr 0xfd) is updated to 1xxx xxxx and an spi interrupt is generated. the exception is if the command byte is 1000 0000. in this case, no mpu interrupt is generated and spi_cmd is not updated. addr 0xxx xxxx status byte0 ... byten write data starting at addr. addr auto - increment s until spi_csz is raised. upon completion, spi_cmd is updated to 0xxx xxxx and an spi interrupt is generated. the exception is if the command byte is 0000 0000. in this case, no mpu interrupt is generated and spi_cmd is not updated. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 76 rev 5 table 64 : spi registers name location rst wk dir description ex_spi 2701[7] 0 0 r/w spi interrupt enable bit. spi_cmd sfr fd[7:0] C C r spi command. the 8 - bit command from the bus master. spi_e 270c[4] 1 1 r/w spi port enable bit. it enables the spi interface on pins segdio36 C segdio39. ie_spi sfr f8[7] 0 0 r/w spi interrupt flag. set by hardware, cleared by writing a 0. spi_safe 270c[3] 0 0 r/w limits spi writes to spi_cmd and a 16 byte region in dram when set. no other write operations are permitted. spi_stat 2708[7:0] 0 0 r spi_stat contains the status results from the previous spi transaction . bit 7 : r eady error: t he 71m654x was not ready to read or write as directed by the previous command. bit 6 : read data parity: this bit is the parity of all bytes read from the 71m654x in the previous command. does not include the spi_stat byte. bit 5 : write data par ity: this bit is the overall parity of the bytes written to the 71m654x in the pre vious command. i t includes cmd and addr bytes. bit 4 -2 : bottom 3 bits of the byte count. does not include addr and cmd bytes. one, two, and three byte in structions return 11 1. bit 1 : spi flash mode: this bit is zero when the test pin is zero. bit 0 : spi flash mode ready: used in spi flash mode. indicates that the flash is ready to receive another write instruction. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 77 spi flash mode (sfm) in normal operati on, the spi slave interface cannot read or write the flash memory. however, the 71m6541d/f /g and 71m6542f/g support an spi f lash m ode (sfm) which facilitates initial programming of the flash memory. when in sfm mode, the spi can erase, read, and write the flash memory . o ther memory elements such as xram and i / o ram are not accessible in this mode. in order to protect the flash contents, several operations are required before the sfm mode is successfully invoked. in sfm mode, n byte reads and dual - byte writes to flash mem ory are supported. see the spi transaction s description on page 73 for the format of read and write commands. since the flash write operation is always ba sed on a two - byte word, the initial address must always be even. data is written to the 16 - bit flas h memory bus after the odd word is written. in sfm mode, the mpu is completely halted. for this reason, the interrupt feature described in th e spi transaction section above is not available in sfm mode. the 71m6541d/f /g and 71m6542f/g must be reset by the wd timer or by the reset pin in order to exit sfm mode. invoking sfm the following conditions must be met prior to invoking sfm: ? pin ice_e = 1. this disables the watchdog and adds another layer of protection against inadvertent flash corruption. ? the external power source (v3p3sys, v3p3a) is at the proper level (> 3.0 vdc) . ? preboot = 0 ( sfr 0xb2[7] ) . this validates the state of the secure bit ( sfr 0xb2[6] ). ? secure = 0. this i/o ram register indicates that spi secure mode is not enabled. operation s are limited to sfm mass erase mode if the secure bit = 1 (flash read back is not allowed in secure mode). ? flsh_unlock[3:0] ( i/o ram 0x2702[7:4] ) = 0010. the i/o ram r egisters sfmm ( i/o ram 0x2080 ) and sfms (i/o ram 0x2081) a re used to invoke sfm. only the spi interface has access to these two registers. this eliminates an indirect path from the mpu f or disabling the watchdog. sfmm and sfms need to be written to in sequence in order to invoke sfm. this sequential write process prevent s inadvertent entering of sfm. the sequence for invoking sfm is: ? first, write to the sfmm ( i/o ram 0x2080 ) register . th e value written to this register defines the sfm mode. o 0xd1: mass erase mode. a flash mass erase cycle is invoked upon entering sfm. o 0x2e: flash read back mode. sfm is entered for flash read back purposes. flash writes are not be blocked and it is up to the user to guarantee that only previously unwritten locations are written. this mode is not accessible when spi secure mode is set. o sfm is not invoked if any other pattern is written to th e sfmm register. ? next, write 0x 96 to the sfms ( i/o ram 0x2081 ) register . this action invoke s sfm provided that the previous write operation to sfmm met the requirements. writing any other pattern to this register does not invoke sfm. additionally, any write operations to this register automatically reset the previously written sfmm register values to zero. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 78 rev 5 sfm details the following occur s upon entering sfm. ? the ce is disabled. ? the mpu is halted. once the mpu is halted it can only be restarted with a reset. this reset can be accomplished with the reset pin , a watchdog reset , or by cycling power (without battery at the vbat pin) . ? the flash control logic is reset in case the mpu was in the middle of a flash write operation or erase cycle. ? mass erase is invoked if specified in the sfmm register, i/o ram 0x2080 (see invoking sfm, above) . the secure bit ( sfr 0xb2[6] ) is cleared at the end of this and all mass erase cycles. ? all spi read and write operation s now refer to flash instead of xram space. the spi host can access the current state of the pending multi - cycle flash access by performing a 4 - byte spi write of any a ddress and checking the status field. all spi write operations in sfm mode must be 6 - byte write transaction that write s two bytes to an even address. the write transactions must contain a command byte of the form 0x xx xxxx . auto incrementing is disabled for write operation s. spi read transactions can make use of auto increment and may access single bytes. the command byte must always be of the form 1xxx xxxx in sfm read transactions. spi commands in sfm interrupts are not generated in sfm since the mpu is halted. the format of the commands is descr ibed in the spi transactions description on page 73 . 2.5.11 hardware watchdog timer a n independent, robust, fixed - duration, watchdog timer (wdt) is included in the 71m6541d/f /g and 71m6542f/g . it uses the rtc crystal oscillator as its time base and must be refreshed by the mpu firmware at least every 1.5 seconds. when not refreshed on time, the wdt overflows and the part is reset as if the reset pin were pulled high, except that the i/o ram bits are in the same state as after a wake - up from slp or lcd modes (see the i/o ram description in 5.2 i/o ram map C alphabetical order for a list of i/o ram bit states after reset and wake - up). after 4100 ck32 cycles (or 125 ms ) following the wdt overflow, the mpu is launched from program address 0x0000 . the watchdog timer is also reset when the internal signal wake=0 (see 3.4 wake up behavior ). for details, see 3.3.4 watchdog timer reset . 2.5.12 test ports (tmuxout and tmux2out p in s) two independent multiplexers allow the selection of internal analog and digital signals for the t muxout and tmux2out pins. these pins are multiplexed with the seg47 and seg46 function. in order to function as test pins, lcd_map[46] ( i/o ram 0x2406[6]) and lcd_map[47] ( i/o ram 0x2406[7] ) must be 0. one of the digital or analog signals listed in table 65 can be selected to be output on the tmuxout pin . the function of the multiplexer is controlled with the i/o ram register tmux [5 :0] (i/o ram 0x2502[ 5 :0] , as shown in table 65 . one of the digital or analog signals listed in table 66 can be selected to be output on the tmux 2 out pin. the function of the multiplexer is controlled with the i/o ram register tmux 2 [4:0] (i/o ram 0x2503[4:0]) , as shown in table 66 . the tmux [5:0] and tmux2 [4:0] i/o ram locations are non - volatile and their contents are preserved by battery power and across resets. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 79 the tmuxout and tmux2out pin s may be used for diagnos tics purposes during the product development cycle or in the production test. the rtc 1 - second output may be used to calibrate the crystal oscillator. the rtc 4 - second output provides higher precision for rtc calibration. rtclk may also be used to calibr ate the rtc. table 65 : tmux[5:0] selections tmux[5:0] signal name description 1 rtclk 32.768 khz clock waveform 9 wd_rst indicates when the mpu has reset the watchdog timer. can be monitored to determine spare time in the watchdog timer. a ckmpu mpu clock C see table 9 d v3aok bit indicates that the v3p3a pin voltage is 3.0 v. the v3p3a and v3p3sys pins are expected to be tied together at the pcb level. the 71m654x monitors the v3p3a pin voltage only. e v3ok bit indicates that the v3p3a pin voltage is 2.8 v. the v3p3a and v3p3sys pins are expected to be tied together at the pcb level. the 71m654x monitors the v3p3a pin voltage only. 1b mux_sync internal multiplexer frame sync signal. see figure 6 and figure 7 . 1c ce_busy interrupt see 2.3.3 on page 25 and figure 16 on page 47 1d ce_xfer interrupt 1f rtm output from ce see 2.3.5 on page 25 note: all tmux[5:0] values which are not shown are reserved. table 66 : tmux2[4:0] selections tmux2[4:0] signal name description 0 wd_ovf indicates when the watchdog timer has expired (overflowed). 1 pulse_1s one second pulse with 25% duty cycle. this signal can be used to measure the deviation of the rtc from an ideal 1 second interval. multiple cycles should be averaged together to filter out jitter. 2 pulse_4s four second pulse with 25% duty cycle. this signal can be used to measure the deviation of the rtc from an ideal 4 second interval. multiple cycles should be averaged together to filter out jitter. the 4 second pulse provides a more precise measurement than the 1 second pulse. 3 rtclk 32.768 khz clock waveform 8 spare[1] bit C i/o ram 0x2704[1] copies the value of the bit stored in 0x2704[1]. for general purpose use. 9 spare[2] bit C i/o ram 0x2704[2] copies the value of the bit stored in 0x2704[2]. for general purpose use. a wake indicates when a wake event has occurred. b mux_sync internal multiplexer frame sync signal. see figure 6 and figure 7 . c mck see 2.5.3 on page 50 e gndd digital gnd. use this signal to make the tmux2out pin static. 12 int0 C dig i/ o interrupt 0. see 2.4.8 on page 41 . also see figure 16 on page 47 . 13 int1 C dig i/o 14 int2 C ce_pulse 15 int3 C ce_busy 16 int4 - vstat 17 int5 C eeprom/spi 18 int6 C xfer, rtc 1f rtm_ck (flash) see 2.3.5 on page 25 . note: all tmux 2[4 :0] values which are not shown are reserved. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 80 rev 5 3 f unctional d escription 3.1 theory of operation the energy delivered by a power source into a load can be expressed as: = t dt tit v e 0 )()( assuming phase angles are constant, the following formulae apply: ? p = real energy [wh] = v * a * cos * t ? q = reactive energy [varh] = v * a * sin * t ? s = apparent energy [vah] = 2 2 q p + for a practical meter, not only voltage and current amplitudes, but also phase angl es and harmonic content may change constantly . thus, simple rms measurements are inherently inaccurate . a modern sol id - state electricity meter ic such as the 71m654x functions by emulating the integral operation above, i.e., it processes current and voltage samples through an adc at a constant frequency . as long as the adc resolution is high enough and the sample frequency is beyond the harmonic range of interest, the curr ent and voltage samples, multiplied with the time period of sampling yield an accurate quantity for the momentary energy . summing up the momentary energy quantities over time result s in very accurate results for accumulated energy. figure 28 : voltage , current, momentary and accumulated energy figure 28 shows the shapes of v(t), i(t), the momentary power and the accumulated power, resul ting from 50 samples of the voltage and current signals over a period of 20 ms . the application of 240 vac and 100 a results in an accumulation of 480 ws (= 0.133 wh) over the 20 ms period, as indicated by the a ccumulated p ower curve . the described sampling method works reliably, even in the presence of dynamic phase shift and harmonic distortion. -500 -400 -300 -200 -100 0 100 200 300 400 500 0 5 10 15 20 current [a] voltage [v] energy per interval [ws] accumulated energy [ws] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 81 3.2 battery modes shortly after system power (v3p3sys) is applied, the part is in mission mode (msn mode) . msn mode means that the part is operating with system power and that the internal pll is stable . this mode is the normal operatin g mode where the part is capable of measuring energy. when system power is not available, the 71m654 x is in o ne of three battery modes: ? brn mode (brownout mode) ? lcd mode (lcd - only mode) ? slp mode (sleep mode) . an internal comparator monitors the voltage at the v3p3sys pin (note that v3p 3sys and v3p3a are typically connected together at the pcb level). when the v3p3sys dc volt age drops below 3.0 vdc, the comparator resets an internal power status bit called v3ok . as soon as system power is removed and v3 ok = 0 , the 71m654 x switches to battery power (vbat pin), notifies the mpu by issuing an interrup t and updates the vstat[2:0] register ( sfr 0xf9[2:0] , see table 68 ) . the mpu continues to execute code when the system transition s from msn to brn mode . refer to 3.2.1 brn mode for the settings that result in the lowest possible power during brn mode. depending on the mpu code, the mpu can choose to stay in brn mode, or transition to lcd or to slp mode ( via the i/o ram bits lcd_only , i/o ram 0x28b2[6] and sleep , i/o ram 0x28b2[7] ) . brn mode is similar to msn mode except that resources powered by v3p3a power , such as the adc are inaccurate. in brn mode the ce continues to run and should be turned off to conserve vbat power . also , the pll continues to function at the same frequency as in msn mode and its frequency should be reduced to save power ( ckgn = 0x24 ( i/o ram 0x2200 ) . when system power is restored, the 71m654 x automatically transition s from any of the battery modes (brn, lcd, slp) back to msn mode, switches back to using system power (v3p3sys, v3p3a), issues an interrupt and updates vstat[1:0] . the mpu software should restore msn mode operation by issuing a soft reset to restore system settings to values appropriate for msn mode. figure 29 shows a state diagram of the various operatin g modes, with the possible transitions between modes . when the part wakes - up under battery power, the part automatically enter s brn mode (see 3.4 wake up behavior ). from brn mode, the part may enter either lcd mode or slp mode, as controlled by the mpu. figure 29 : operation modes state diagram v3p3sys rises v3p3sys falls msn brn lcd sleep or vbat insufficient system power battery power lcd_only reset & vbat sufficient reset wake flags wake event reset & vbat insufficient v3p3sys rises v3p3sys rises slp wake event vbat insufficient vbat insufficient vstat=001 vstat=00x downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 82 rev 5 transitions from both lcd and slp mode to brn mode c a n b e initiated by the following events: ? w ake - up timer time out. ? p ushbutton (pb) is activated . ? a rising edge on segdio4, or a high logic level on segdio52 ( 71m6542f/g only) or segdio55. ? activity on the rx or opt_rx pins. the mpu has access to a variety of registers that signal the event that caused the wake up. see 3.4 wake up behavior for details. table 67 shows the circuit functions available in each operating mode. table 67 : available circuit functions circuit function system power battery power msn (mission mode) brn (brownout mode) lcd sleep pll_fast=1 pll_fast=0 pll_fast=1 pll_fast=0 ce (computation engine) yes yes note 1 note 1 -- 2 -- fir yes yes -- -- -- -- adc, vref yes yes -- -- -- -- pll yes yes yes yes b oost 2 -- battery measurement yes yes yes yes -- -- temperature sensor yes yes yes yes yes yes max mpu clock rate 4.92mhz (from pll) 1.57mhz (from pll) 4.92mhz (from pll) 1.57mhz (from pll) -- -- mpu_div clk. divider yes yes yes yes -- -- ice yes yes yes yes -- -- dio pins yes yes yes yes -- -- watchdog timer yes yes yes yes -- -- lcd yes yes yes yes yes -- lcd boost yes yes yes yes yes eeprom interface (2 - wire) yes yes yes yes -- -- eeprom interface (3 - wire) yes yes yes yes -- -- uart (full speed) yes yes yes yes -- -- optical tx modulation 38.4khz 38.9khz 38.4khz 38.9khz -- -- flash read yes yes yes yes -- -- flash page erase yes yes yes yes -- -- flash write yes yes yes yes -- -- ram read and write yes yes yes yes -- -- wakeup timer yes yes yes yes yes yes osc and rtc yes yes yes yes yes yes dram data preservation yes yes yes yes -- -- nv ram data preservation yes yes yes yes yes yes notes: 1. the ce is active in brn mode, but adc data is inaccurate. the mpu should halt the ce to c onserve power ( ce _e = 0 , i/o ram 0x2106 [0] ). 2. -- indicates that the corresponding circuit is not active 3. boost implies that the lcd boost circuit is active (i.e., lcd_vmode[1:0] = 10 ( i/o ram 0x2401[7:6] ) . t he lcd boost circuit requires a clock from the pll to function. thus, the pll is automati cally kept active if lcd boost is active while in lcd mode , otherwise the pll is de - activated . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 83 3.2.1 brn mode in brn mode, most non - metering digital functions are active (as shown in table 67 ) i ncluding ice, uart, eeprom, lcd and rtc. in brn mode, the pll continues to function at the same frequency as msn mode. it is up to the mpu to scale down the pll (using pll_fast, i/o ram 0 x2200[4] ) or the mpu frequen cy (using mpu_div [2:0], i/o ram 0x2200[2:0] ) in order to save power. from brn mode, the mpu can choose to enter lcd or slp modes. when system power is re stored while the 71m654 x is in brn mode, the part automatical ly transitio ns to msn mode . the recommended minimum power configuration for brn mode is as follows: ? rce0 = 0 x00 ( i/o ram 0x2709[7:0] ) - remote sensors disabled ? lcd_bat = 1 ( i/o ram 0x2402[7] ) - lcd powered from vbat ? lcd_vmode[1:0] = 0 ( i/o ram 0x2401[7:6] ) - 5v lcd boost disabled ? ce6 = 0 x00 ( i/o ram 0x2106 ) - ce, rtm and chop are disabled ? mux_ div[ 3 :0] = 0 ( i/o ram 0x2100[7:4]) - the adc multiplexer is disabled ? adc_e = 0 ( i/o ram 0x2704[4] ) - adc disabled ? vref_cal = 0 ( i/o ram 0x2704[7] ) C v ref not driven out ? vref_dis = 1 ( i/o ram 0x2704[6] ) - vref disabled ? pre_e = 0 ( i/o ram 0x2704[5] - pre - amp disabled ? bcurr = 0 ( i/o ram 0x2704[3] ) - battery 100a current load off ? tmux[5:0] = 0x0e ( i/o ram 0x2502[5:0] ) C tmux out output set to a dc value ? tmux2[4:0] = 0x0e ( i/o ram 0x2 50 3 [4:0] ) C tmuxout2 output set to a dc value ? ckgn = 0x24 ( i/o ram 0x2200 ) - pll set slow, mpu_div[ 2 :0] ( i/o ram 0x2200[2:0]) set to maximum ? temp_per [2:0] = 6 ( i/o ram 0x28a0[2:0] ) - temp measurement set to automatic every 512 s ? temp_bsel = 1 ( i/o ram 0x28a0[7] ) - temperature sensor monitors vbat ? pcon = 1 ( sfr 0 x 87 ) - at the end of the main brn loop, halt the mpu and wait for an interrupt ? the baud rate registers are adjusted as desired ? all unused interrupts are disabled 3.2.2 lcd mode lcd mode may be commanded by the mpu at any time by setting the lcd_only control bit ( i/o ram 0x2 8b2 [6] ). however, it is recommended that the lcd_only control bit be set by the mpu only after the 71m654x has entered brn mode. for example, if the 71m654x is in msn mode wh en lcd_only is set , the duration of lcd mode is very brief and the 71m654x immediately 'wake s '. in lcd mode, v3p3d is disabled, thus removing all current leakage from the vbat pin . before asserting lcd_only mode, it is recommended that the mpu minimize pl l current by reducing the output fre quency of the pll to 6.2 mhz (i.e., write pll_fast = 0, i/o ram 0x2200[4] ). the lcd boost system requires a clock from the pll for its operation . thus, if the lcd boost system is enabled (i.e., lcd_vmode[1:0] = 10, i/o ram 0x2401[7:6] ), then the pll is automatically kept active during lcd mode , otherwise the pll is de - activated . in lcd mode, the data contained in the lcd_seg registers is displayed using the segment driver pins . u p to two lcd segments connected to the pi ns seg dio22 and segdio23 can be made to blink without the involvement of the mpu, which is disabled in lcd mode. to minimize battery power consumption , only segments that are used should be enabled. after the transition from lcd mode to msn or brn mode, th e pc (program counter) is at 0x0000, the xram is in an undefined state, and c onfiguration i/o ram bits are reset (see table 76 for i/o ram state upon wake) . the d ata stored in non - volatile i/o ram locations is pre served in lcd mode ( the shaded locations in table 76 are non - volatile). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 84 rev 5 3.2.3 slp mode when the v3p3sys pin voltage drops below 2.8 vdc, the 71m654x enters brn mode and the v3p3d pin obtains power from the vbat pin instead of the v3p3sys pin. once in brn mode, the mpu may invoke slp mode by setting the sleep bit (i/o ram 0x28b2[7] ) . the purpose of slp mode is to consume the least amount power while still maintaining the rtc (real time clock) , temperature compensation of the rtc, and the non - volatile porti ons of the i/o ram. in slp mode, the v3p3d pin is disconnected, removing all sources of current leakage from the vbat pin . the non - volatile i/o ram locations and the slp mode functions, such as the temperature sensor, oscillator, rtc, and the rtc temperature compensation are powered by the vbat_rtc pin . slp mode can be exited only by a system power - up event or one of the wake methods described in 3.4 wake up behavior . if the sleep bit is asserted when v3p3sys pin power is present (i.e. , while in msn mode) , the 71m654 x enter s slp mode , resetting the internal wake signal , at which point the 71m654x begin s the standard wake from sleep procedures as described in 3.4 wake up behavior . when power is restored to the v3p3sys pin, the 71m654x transition s f rom slp mode to ms n mode and the mpu pc (program counter) is initialized to 0x0000. at this point, the xram is in an undefined state, but non - volatile i/o ram locations are pre served (the shaded locations in table 76 are non - volatile ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 85 3.3 fault and reset behavior 3.3.1 events at power - down power fa ult detection is performed by internal comparators that monitor the voltage at the v3p3a pin and also monitor the in ternal ly generated vdd pin voltage (2.5 vdc). the v3p3sys and v3p3a pins must be tied together at the pcb level, so that the comparators, which are internally connected onl y to the v3p3a pin, are able to simultaneously monitor the common v3p3sys and v3p3a pin voltage . the following discussion assumes that the v3p3a and v3p3sys pins are tied together at the pc b level. during a power failure, as v3p3a falls, two thresholds are detected: ? the first threshold, at 3 .0 vdc ( vstat[2:0] = 001 ), warns the mpu that the analog modules are no longer accurate. other than warning the mpu, the hardware takes no action when this thres hold is crossed. ? the second threshold, at 2.8 vdc, cause s the 71m654x to switch to battery power. this switching happen s while the flash and ram systems are still able to read and write. the power quality is reflected by the sfr vstat[2:0] field , as shown in table 68 . the vstat[2:0] field is located at sfr address 0x f9 and occupies bits [ 2: 0 ], and it is read - only. in addition to the state of the main power, the vstat[2:0] register provide s information about the internal vdd voltage under battery power. note that if system power (v3p3a) is above 2.8 vdc , the 71m6541d/f /g and 71m6542f/g always switch from battery to system power. table 68 : vstat[2:0 ] (sfr 0xf9[2:0]) vstat[2:0] description 000 system power ok. v3p3a > 3.0 vdc . analog modules are functional and accurate. 001 system power is l ow. 2.8 vdc < v3p3a < 3.0 vdc . analog modules not accurate. switch over to battery power is imminent. 010 the ic is on b att ery power and vdd is ok. vdd > 2.25 vdc . the ic has f ull digital functionality. 011 the ic is on battery power and 2.25 vdc > vdd > 2.0 vdc . flash write operation s are inhibited. 101 the ic is on battery power and vdd < 2.0, which means that the mpu is nearly out of vol tage. a reset occur s in 4 cycles of the crystal clock ck32 . the response to a system power fault is almost entirely controlled by firmware. duri ng a power failure, system power slowly fall s . thi s is monitored by internal comparator s that cause the hardware to automatically switch over to taking power from the v bat input. an interrupt notifies the mpu that the part is now battery powered. at this point, it is the mpus responsibility to reduce power by slowing the clock rate, disabling the pll, etc. precision analog components such as the bandgap reference, the bandgap buffer, and the adc are powered only by the v3p3a pin and become inaccurate and ultimately unavailable as the v3p3a pin voltage continues to drop (i.e., circuits powered by the v3p3a pin are not backed by the vbat pin ) . when the v3p3a pin falls below 2.8 vdc, the adc clocks are halted and the am plifiers are unbiased . meanwhile, control bits such as adc_e bit (i/o ram 0x2704[4]) are not affected, since the ir i/o ram storage is powered from the vdd pin (2.5 vdc ) . the vdd pin is supplied with power through an internal 2.5 vdc regulator that is connected to the v3p3d pin. in turn, the v3p3d pin is switched to rec eive power from the vbat pin when the v3p3sys pin drops below 3.0 vdc. note that the v3 p3sys and v3p3a pins are typically tied together at the pcb level. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 86 rev 5 3.3.2 ic behavior at low battery voltage when system power is not present, the 71m6541d/f /g and 71m6542f/g rely on the vbat pin for power. if the vbat voltage is not sufficient to maintain vdd at 2.0 vdc or greater, the mpu cannot operate reliably. low vbat voltage can occur while the part is operating in brn mode, or while it is dormant in slp or lcd mode . two cases can be distinguished, depending on mpu code: ? case 1: system power is not present , and the part is waking from slp or lcd mode. in this case, the hardware checks the value of vdd to determine if processor operation is possible. if it i s not possible, the part configures itself for brn operation, and holds the processor in reset (wak e=0). in this mode, vbat powers the 1.0 vdc reference for the lcd system, the vdd regulator, the pll, and the fault comparator. the part remain s in this waiting mode until vdd becomes high due to system power being applied or the vbat battery being replaced or recharged. ? case 2: the part is operating under vbat power and vstat [2:0] ( sfr 0xf9[2:0] ) becomes 101, in dicating that vdd falls below 2.0 vdc . in this cas e , the firmware has two choices: 1) one choice is to assert the sleep bit ( i/o r am 0x28b2[7]) immediately. this assertion preserve s the re maining charge in vbat. of course, if the battery voltage is not increased, the 71m654 x enter s case 1 as soon as it tries to wake up. 2) the alternative choice is to enter the waiting mode described in case 1 immediately. specifically, if the firmware does not assert the sleep bit , the hardware reset s the processo r four ce32 clock cycles ( i.e., 122 s) after vstat [2:0] becomes 101 and, as described in case 1, it begin s waiting for vdd to b ecome greater than 2 .0 vdc . the mpu wake s up when system power returns , or when vdd be comes greater than 2.0 vdc . in either case, when vdd recovers, and when the mpu wakes up, the wf_badvdd flag ( i/o ram 0x28b0[2] ) can be read to determine that the processor is recovering from a bad vbat condition. the wf_badvdd flag remain s set until the next time wake falls. this flag is independent of the other wf flags. in all cases, low vbat voltage does not corrupt rtc operation, the state of nv memory, or the state of non - volatile memory. these circuits depend on the vbat_rtc pin for power. 3.3.3 reset sequence when the reset pin is pulled high, all digital activity in the chip stops, with the exception of the oscillator an d rtc. additionally, all i / o ram bits are forced to their rst state. reliable reset does not occur unti l reset has been high at least for 2 s. note that tmux and the rtc do not reset unless the test pin is pulled high while reset is high . the reset con trol bit ( i/o ram 0x 2200[3] ) performs an identical reset to the reset pin except that a significantl y shorter reset timer is used. once initiated, the reset sequence wait s until the reset timer times out. the time - out occur s in 4100 ce32 cycles (125 ms), at which time the mpu begin s executing its pre - boot and boot sequences from address 0x00 00. see 2.5.1.1 hardware watchdog timer for a detailed description of the pre - boot and boot sequences . if system power is not present, the reset timer duration is two ce32 cycles, at which time the mpu begin s executing in brn mode, starting at address 0x0000. a softer form of reset is initiated when the e_rst pin of the ice interface is pulled low . this event caus es the mpu and other registers in the mpu core to be reset but does not reset the remainder of the ic , for example the i/o ram. it does not trigger the reset sequence. this type of reset is intended to re set the mpu program, but not to make other changes to the chips state. 3.3.4 watchdog timer reset the watchdog timer (wd t ) i s described in 2.5.11 hardware watchdog timer . a status bit, wf_ovf (i/o ram 0x28b0[4]) , is set when a wdt overflow occurs. similar to the other wake flags, this bit is powered by the non - volatile supply and can be read by the mpu to determine if the part is initializing after a wd overflow event or after a power up. the wf_ovf bit is cleared by the reset pin. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 87 there is no internal digital state that could deactivate the wd t . for debug purposes, however, the wd t can be disabled by rais ing the ice_e pin to 3.3 vdc . in normal operation, the wdt is reset by periodically writing a one to the wd_rst control bit ( i/o ram 0x28b4[7]) . the watchdog ti mer is also reset when the 71m654x wakes from lcd or slp mode , and when ice_e = 1. 3.4 wake up behavior as described above, the part always wake s- up in msn mode when system power is restored . as de scribed in 3.2 battery modes , t ransitions from both lcd and slp mode to brn mode c a n b e initiated by a w ake - up timer timeout, when the p ushbutton (pb) input is high , a rising ed ge on segdio4, or a high logic level on segdio52 or segdio55, or by activity on the rx or opt_rx pins. 3.4.1 wake on hardware events the following pin signal events wake the 71m654x from slp or lcd mode: a high level on the pb pin, either edge on the rx pin, a rising edge on the segdio4 pin, a high level on the segdio52 pin ( 71m6542f/g only), or a high level on the segdio55 pin or either edge on the opt_rx pin. see table 69 for de - bounce details on each pin and for further details on the opt_rx/segdio55 pin. t he segdio4 , seg dio52 ( 71m6542f/g only) , and seg dio55 pins must be configured as dio inputs and their wake enable ( ew_x bits) must be set. in slp and lcd modes, the mpu is held in reset and cannot poll pins or react to interrupts. when one of the hardware wake events occurs, the internal wake signal rises and within three ck32 cycles the mpu begins to execute. the mpu can de ter mine which one of the pins awakened it by checking the wf_pb , wf_rx , wf_segdio4 , wf_dio52 ( 71m6542f/g only) , or wf_dio55 flags (see table 69 ) . if the part is in slp or lcd mode, it can be awakened by a high level on the pb pin. this pin is normally pulled to gnd and can be connected externally so it may be pulled high by a push button depression . some pins are de - bounced to reject emi noise. detection hardware ignore s all transitions after the initial transition . table 69 shows which pins ar e equipped with de - bounce circuitry. pins that do not have de - bounce circ uits must still be high for at least 2 s to be recognized. the wake enable and flag bits are also shown in table 69 . the wake flag bits are set by hardware when the mpu wakes from a wake event. note that the pb flag is set whenever the pb is pushed, even if the part is already awake. table 71 lists the events that clear the wf flags. in addition to push buttons and timers, the part can also reboot due to the reset pin, the r ese t bit ( i/o ram 0x2200[3] ), the wdt , the c old start det ector, and e_rst. as seen in table 69 , each of these mechanisms has a flag bit to alert the mpu to the source of the wakeup. if the wake - up is caused by re turn of system power, there is no active wf flag and the vstat [2:0] field ( sfr 0xf9[2:0] ) indicate that system power is stable . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 88 rev 5 table 69 : wake enables and flag bits wake enable wake flag de - bounce description name l ocation name l ocation wake_arm 28b2[5] wf_tmr 28b1[5] no wake on timer . ew_pb 28b3[3] wf_pb 28b1[3] yes wake on pb *. ew_rx 28b3[4] wf_rx 28b1[4] 2 s wake on either edge of rx . ew_dio 4 28b3[2] wf_dio4 28b1[2] 2 s wake on seg dio4. ew_dio 52 ? 28b3[1] wf_dio 52 28b1[1] yes wake on seg dio52 *. ew_dio 55 28b3[0] wf_dio 55 28b1[0] yes opt_rxdis = 1: w ake on dio55 * with 64 ms de - bounce . opt_rxdis = 0: w ake on either edge of opt_rx with 2 s de - bounce. opt_rxdis: i/o ram 0x2457[2] always enabled wf_rst 28b0[6] 2 s wake after reset. always enabled wf_rstbit 28b0[5] no wake after reset bit . always enabled wf_erst 28b0[3] 2 s wake after e_rst . (ice must be enabled) always enabled wf_ovf 28b0[4] no wake after wd reset . always enabled wf_cstart 28b0[7] no wake after cold start - the first application of power. always enabled wf_badvdd 28b0[2] no wake after insufficient vbat voltage. ? 71m6542f/g only . *this pin is sampled every 2 ms and must remain high for 64 ms to be declared a valid high level. this pin is high - level sensitive. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 89 table 70 : wake bits name location rst wk dir description ew_dio 4 28b3[2] 0 C r/w connects segdio4 to the wake logic and permits segdio4 rising to wake the part. this bit has no effect unless segdio4 is configured as a digital input. ew_dio 52 28b3[1] 0 C r/w connects dio52 to the wake logic and permits dio52 high - level to wake the part ( 71m6542f/g only) . this bit has no effect unless dio52 is configured as a digital input. ew_dio 55 28b3[0] 0 C r/w connects dio55 to the wake logic and permits dio55 high - level to wake the part. this bit has no effect unless dio55 is configured as a digital input. wake_arm 28b2[5] 0 C r/w arms the wake timer and loads it with the value in the wake_tmr register ( i/o ram 0x2880 ). when slp mode or lcd mode is asserted by the mpu, the wake timer become s active. ew_pb 28b3[3] 0 C r/w connects the pb pin to the wake logic and permits pb high - level to wake the part. pb is always configured as an input. ew_rx 28b3[4] 0 C r/w connects the rx pin to the wake logic and permits rx ris ing to wake the part. see 3.4.1 for de - bounce issues. wf_dio 4 28b1[2] 0 C r segdio4 flag bit. if segdio4 is configured to wake the part, this bit is set whenever segdio4 ri ses. it is held in reset if segdio4 is not configured for wakeup. wf_dio 52 28b1[1] 0 C r seg dio52 flag bit. if seg dio52 is configured to wake the part, this bit is set whenever seg dio52 is a high level . it is held in reset if seg di o 52 is not configured for wakeup ( 71m6542f/g only) . wf_dio 55 28b1[0] 0 C r seg dio55 flag bit. if seg dio55 is configured to wake the part, this bit is set whenever seg dio55 is a high level . it is held in reset if segdio 55 is not configured for wakeup. wf_tmr 28b1[5] 0 C r indicates that the wake timer caused the part to wake up. wf_pb 28b1[3] 0 C r indicates that the pb pin caused the part to wake. wf_rx 28b1[4] 0 C r indicates that rx pin caused the part to wake. wf_rst wf_rstbit wf_erst wf_cstart wf_badvdd 28b0[6] 28b0[5] 28b0[3] 28b0[7] 28b0[2] * * * * * C r indicates that the rst pin, e _ rst pin, reset bit ( i/o ram 0x2200[3]) , the cold start detector, or low voltage on the vbat pin caused the part to re set. *see table 71 for details. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 90 rev 5 table 71 : clear events for wake flags flag wake on: clear events wf_tmr timer expiration wake falls wf_pb pb pin high level wake falls wf_rx either edge rx pin wake falls wf_dio4 segdio4 rising edge wake falls wf_dio52 segdio52 high level ( 71m6542f/g only) wake falls wf_dio55 if opt_rxdis = 1 ( i/o ram 0x2457[2] ), wake on segdio55 high if opt_rxdis = 0 wake on either edge of opt_rx wake falls wf_rst reset pin driven high wake falls, wf_cstart , wf_rstbit , wf_ovf , wf_badvdd wf_rstbit reset bit is set ( i/o ram 0x2200[3] ) wake falls, wf_cstart , wf_ovf , wf_badvdd , wf_rst wf_erst e_rst pin driven high and the ice interface must be enabled by driving the ice_e pin high. wake falls, wf_cstart, wf_rst, wf_ovf, wf_rstbit wf_ovf watchdog (wd) reset wake falls, wf_cstart , wf_rstbit , wf_badvdd , wf_rst wf_cstart coldstart (i.e., after the application of first power) wake falls, wf_rstbit , wf_ovf , wf_badvdd , wf_rst note: wake falls implies that the internal wake signal has been reset, which happens aut omatically upon entry into lcd mode or sleep mode (i.e., when the mpu sets the lcd_only bit ( i/o ram 0x28b2[6] ) or the sleep ( i/o ram 0x28b2[7] ) bit) . when the internal wake signal resets, all wake flags are reset. since the various wake flags are automatically reset when wake falls, it is not ne cessary for the mpu to reset these flags before entering lcd mode or sleep mode. also, other wake events can cause the wake flag to reset, as indicated above (e.g., the wf_r st flag can also be reset by any of the following flags setting: wf_cstart , ws_rstbit , wf_ovf , wf_badvdd ) 3.4.2 wake on timer if the part is in slp or lcd mode, it can be awakened by the wake t imer. until th is timer times out, the mpu is in reset due to the i nternal wake signal being low. when the wake t imer times out, wake rises and within three ck32 cycles, the mpu begins to execute. the mpu can determine that the timer woke it by checking the wf_tmr wake flag ( i/o ram 0x28b1[2] ) . the wake t imer begins timing when the part enters lcd or slp mode. its duration is controlled by the value in the wake_tmr [7:0] register (i/o ram 0x2880) . the timer duration is wake_tmr +1 seconds. the wake t imer is armed by setting wake_arm = 1 ( i/o ram 0x28b2[5] ) . it must be armed at least three rtc cycles before either slp or lcd modes are initiated. setting wake_arm presets the timer with the value in wake_tmr and rea dies the timer to start when the mpu writes to the sleep (i /o ram 0x28b2[7] ) or lcd_only (i/o ram 0x28b2[6]) bits . the timer is neither reset nor disarmed when the mpu wakes - up. thus, once armed and set, the mpu continue s to be awakened wake_tmr [7:0] seconds after it requests slp mode or lcd mode (i.e., once written, the wake_tmr[7:0] register holds its value and does not have to be re - written each time the mpu enters slp or lcd mode. also, since wake_tmr[7:0] is non - volatile, it also holds its value through resets and power failures). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 91 3.5 data flow and mpu/ce communication the data flow between the compute engine ( ce ) and the mpu is shown in figure 30 . in a typical ap plication, the 32 - bit ce se quen tially processes the samples from the voltage inputs on pins ia, va , ib, etc., performing calculations to measure active power (wh), reactive power (varh) , a 2 h, and v 2 h for four - quadrant metering . these measurements are then accessed by the mpu, processed further and output using the peripheral devices available to the mpu. both the ce and multiplexer are controlled by the mpu via shared registers in the i/o r am and in ram. the ce outputs a total of six discrete signals to the mpu. these consist of fo ur pulses and two interrupt s: ? ce_busy ? xfer_busy ? wpulse, vpulse (pulses for active and reactive energy) ? xpulse, ypulse (auxiliary pulses) these interrupts are connected to the mpu interrupt service inputs as external interrupts. ce_busy indicates that the ce is actively processing data. this signal occur s once every multiplexer cycle (typically 396 s), and indicates that the ce has updated status information in its cestatus register ( ce ram 0x80 ). xfer_busy indicates that the ce is updating data to the output region of the ram. this indication occur s when ever the ce has finished generating a sum by completing an accumulation interval determined by sum_samp s [12:0] , i/o ram 0x2107[4:0], 2108[7:0], (typically every 1000 ms) . interrupts to the mpu occur on the falling edges of the xfer_busy and ce_busy signals. wpulse and vpulse are typically used to signal energy accumulation of real (wh) and reac tive (varh) energy. tying wpulse and vpulse into the mpu interrupt system can support pulse counti ng. xpulse and ypulse can be used to signal events such as sags and zero crossings of the mains v oltage to the mpu. tying these outputs into the mpu interrupt system relieves the mpu from having to read the cestatus register at every occurrence of the ce_busy interrupt in order to detect sag or zero cross ing events. figure 30 : mpu/ce data flow refer to 5.3 ce interface description for additional information on setting up the device using the mpu firmware. mpu ce i/o ram (configuration ram) pulses samples wpulse vpulse xpulseypulse control processed metering data mux control control interrupts ceconfig cestatus xram ce_busy xfer_busy downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 92 rev 5 4 a pplication i nformation 4.1 connecting 5 v devices all digital input pins of the 71m654x are compatible with external 5 v devices. i/o pins configured as inputs do not require current - limiting resistors when they are connected to external 5 v devices. 4.2 direct connection of sensors figure 31 through figure 34 show voltage - sensin g resistive dividers, current - sensing current transformers (cts) and current - sensing resistive shunts and how they are connected to the voltage and current inputs of the 71m654x. all input signals to the 71m654x sensor inputs are voltage signals providing a scaled representation of either a sensed voltage or current. the analog input pins of the 71m654x are designed for sensors with low source impedance. rc filters with resistance values higher than those implemented in the demo boards must not be used. r efer to the demo board schematics for complete sensor input circuits and corresponding component values. r in v in r out v3p3a va figure 31 : resistive voltage divider (voltage sensing) i in iap v3p3a v out i out r burden ct 1:n noise filter figure 32 . ct with single - ended input connection (current sensing) i in iap ian v3p3a v out i out r burden ct 1:n bias network and noise filter figure 33 : ct with differential input connection (current sensing) i in r shunt iap ian v3p3a v out bias network and noise filter figure 34 : differential resistive shunt connections (current sensing) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 93 4.3 71m6541d/f /g u sing local sensors figure 35 shows a 71m6541d/f /g configuration using locally connected current sensors. the iap - ian current channel may be directly connected to either a shunt resistor or a ct, while the ib p - ibn channel is connected to a ct and is therefore isolated. this configuration implements a sin gle - phase measurement with tamper - detection using one current sensor to measure the neutral current. this configuration can also be used to create a split phase meter (e.g., ansi form 2s). for best performance, both the iap - ian and ibp - ibn current sensor inputs are configured for differential mode (i.e., diffa_ e = 1 and diffb_e = 1, i/o ram 0x2 10c [4] and 0x210c[5] ). the ibp - ibn input must be configured as an analog differential input disabling the remote sensor interface (i.e., rmt_e = 0, i/o ram 0x2709[3] ). see figure 2 for the afe configuration corresponding to figure 35 . mpu rtc timers iap va ibp xin xout rx tx txrx com0...5 v3p3a v3p3 sys vbat vbat_rtc seg gnda gndd seg/dio dio ice line neutral load 8888.8888 pulses, dio ir amr power fault comparator modul- ator serial ports oscillator/ pll mux and adc lcd driver dio, pulses compute engine flash memory ram 32 khz regulator ct power supply 71m6541d/f/g temperature sensor vref battery pwr mode control wake-up neutral i 2 c or wire eeprom ianibn rtc battery v3p3d battery monitor spi interface host lcd display resistor divider ct line line note: this system is referenced to line shunt or 11/5/2010 figure 35 . 71m6541d/f /g with local sensors downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 94 rev 5 4.4 71m6541d/f /g using 71m6x01and current shunts figure 36 shows a typical connection for one isolated and one non - isolated shunt sensor, using the 71m6 x01 isolated sensor interface. this configuration implements a single - phase measurement with tampe r- detection using the second current sensor. this configuration can also be used to create a split phase meter (e.g., ansi form 2s). for best performance, the iap - ian current sensor input is configured for differential mode (i.e., diffa_ e = 1, i/o ram 0x2 1 0c [4] ). the outputs of the 71m6 x 01 isolated sensor interface are routed through a pulse transformer , whi ch is connected to the pins ibp - ibn . the ibp - ibn pins must be configured for remote sensor communication (i.e., rmt_e =1, i/o ram 0x2709[3] ). see figure 3 for the afe configuration corresponding to figure 36 . mpu rtc timers iap va ibp xin xout rx tx txrx com0...5 v3p3a v3p3 sys vbat vbat_rtc seg gnda gndd seg/dio dio ice line neutral load 8888.8888 pulses, dio ir amr power fault comparator modul- ator serial ports oscillator/ pll mux and adc lcd driver dio, pulses compute engine flash memory ram 32 khz regulator shunt power supply 71m6541d/f/g temperature sensor vref battery pwr mode control wake-up neutral i 2 c or wire eeprom ianibn rtc battery v3p3d battery monitor spi interface host lcd display resistor divider pulse trans-former 71m6xx1 shunt line line note: this system is referenced to line 11/5/2010 figure 36 : 71m6541d/f /g with 71m6x01 isolated sensor downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 95 4.5 71m6542f/g using local sensors figure 38 shows a 71m6542f/g configuration using locally connected current sensors. the iap - ian current channel may be directly connected to either a shunt resistor or a ct, while the ib p - ibn channel i s connected to a ct and is therefore isolated. this configuration implements a dual - phase measurement utilizing equation 2 . for best performance, both the iap - ian and ibp - ibn current sensor inputs are configured for differential mode (i.e., diffa_ e = 1 and diffb_e = 1, i/o ram 0x2 10c [4] and 0x210c[5] ) . the ibp - ibn input must be configured as an analog differential input disabling the remote sensor interface (i.e., rmt_e = 0, i/o ram 0x2709[3] ). see figure 4 for the afe configuration corresponding to figure 38 . mpu rtc timers iap va ibp xin xout rx tx txrx com0...5 v3p3a v3p3 sys vbat vbat_rtc seg gnda gndd seg/dio dio ice phase a neutral load 8888.8888 pulses, dio ir amr power fault comparator modul- ator serial ports oscillator/ pll mux and adc lcd driver dio, pulses compute engine flash memory ram 32 khz regulator shunt power supply 71m6542f/g temperature sensor vref battery pwr mode control wake-up phase a i 2 c or wire eeprom ian ibn rtc battery v3p3d battery monitor spi interface host lcd display resistor dividers phase b load vb neutral phase a shunt note: this system is referenced to phase a 11/5/2010 ct or fig ure 37 : 71m6542f/g with local sensors downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 96 rev 5 4.6 71m6542f/g using 71m6x01 and current shunts figure 38 shows a typical two - phase connection for the 71m6542f/g using one isolated and one non - isolated sensor. for best performance, the iap - ian current sensor input is configured for differential mode (i.e., diffa_ e = 1, i/o ram 0x2 10c [4] ) . the 71m6x 01 isolated sensor inte rface is used to isolate phase b . the outputs of the 71m6x 01 isolated sensor interface are routed through a pulse transformer, which is connect ed to the pins ibp - ibn . the ibp - ibn pins must be configured for remote sensor communication (i.e., r mt_e =1, i/o ram 0x2709[3] ). see figure 5 for the afe configuration corresponding to figure 38 . mpu rtc timers iap va ibp xin xout rx tx txrx com0...5 v3p3a v3p3 sys vbat vbat_rtc seg gnda gndd seg/dio dio ice phase a neutral load 8888.8888 pulses, dio ir amr power fault comparator modul- ator serial ports oscillator/ pll mux and adc lcd driver dio, pulses compute engine flash memory ram 32 khz regulator shunt power supply 71m6542f/g temperature sensor vref battery pwr mode control wake-up phase a i 2 c or wire eeprom ian ibn rtc battery v3p3d battery monitor spi interface host lcd display resistor dividers pulse trans-former 71m6xx1 phase b load vb neutral phase a shunt note: this system is referenced to phase a figure 38 : 71m6542f/g with 71m6 x 01 isolated sensor downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 97 4.7 metrology temperature compensation 4.7.1 voltage reference precision since the vref band - gap amplifier is chopper - stabilized, as set by the chop_e[1:0] (i/o ram 0x2106[3:2]) control field , the dc offset voltage, which is the most significant long - term drift mechanism in the voltage reference s (vref), is automatically removed by the chopper circuit. both the 71m654x and the 71m6x01 feature chopper circuits for their respective vref voltage reference. maxim implements a trimming procedure of the vref voltage reference during the device manufacturing process. the reference voltage (vref ) is trimmed to a target value of 1.195v. during this trimming process, the trimt[7:0] ( i/o ram 0x2309 ) value is stored in non - volatile fuses. trimt[7:0] is trimmed to a value that results in minimum vref variation with temperature. for the 71m654x device, the trimt[7:0] value can be read by the mpu during initialization in order to calculate parabolic temperature compensation coefficients suitable for each individual 71m654x device. the resulting temperature coefficient for vref in the 71m654x is 40 ppm/ c. considering the factory calibration temperature of vref to be +22c and the industrial temperature range ( - 40c to +85c), the vref error at the temperature extremes for the 71m654x device can be calculated as: % 252 .0 2520 / 40 ) 22 85( += += ? ? ppm c ppm c c o o o and % 248 .0 2480 / 40 ) 22 40 ( ?= ?= ? ? ? ppm c ppm c c o o o the above calculation implies that both the voltage and the current measurements are individually subject to a theoretical maximum error of approximately 0.25%. when the voltage sample and current sample are multiplied together to obtain the energy per sample, the voltage error and current error combine resulting in approximately 0.5% maximum energy measurement error. however, this theoretical 0.5% error considers only the voltage reference (vref) as an error source. in practice, ot her error sources exist in the system. the principal remaining error sources are the current sensors (shunts or cts) and their corresponding signal conditioning circuits, and the resistor voltage divider used to measure the voltage. the 71m654 x device s sho uld be used in class 1% designs, allow ing sufficient margin for the other error sources in the system. 4.7.2 temperature coefficients for the 71m654x the equations provided below for calculating tc1 and tc2 apply to the 71m654 x . in order to obtain tc1 and tc2, t he mpu reads trimt[7:0] ( i/o ram 0x2309 ) and uses the tc1 and tc2 equations provided. ppmc and ppmc2 are then calculated from tc1 and tc2, as shown. the resulting tracking of the refer ence voltage (vref) is within 4 0 ppm/c . see 4.7.1 voltage reference precision . ]0:7[ 95.4 275 1 trimt tc ? ? = ]0:7[ 10 8.2 557.0 2 4 trimt tc ? ? ? ?= ? 1 4632 .22 1 195 .1 5 2 7 21 tc tc ppmc ? = ? ? = 2 116 . 1150 2 195 .1 5 2 2 8 29 tc tc ppmc ? = ? ? = the coefficients multiplying tc1 and tc2 to obtain ppmc and ppmc2 are derived from the 1.1 95v adc voltage reference and scaling performed in the ce, as shown above. see 4.7.3 and 4.7.4 b elow for further temperature compensation details. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 98 rev 5 4.7.3 temperature compensation for vref with local sensors this section discusses metrology temperature compensation for the meter designs where local sens ors are used, as shown in figure 35 and fig ure 37 . i n these configurations where all sensors are directly connected to the 71m654x, each sensor channels accuracy is affected by the voltage variation in the 71m654x vref due to temperature. the vref in the 71m654x can be compensated digitally using a second - order polynomial function of temperature. the 71m654x features an on - chip temperature sensor for the purpose of temperature compensating its vref. there are also error sources external to the 71m654x. the voltage sensor resistor dividers and the shunt current sensor and/or ct and their corresponding signal conditioning circuits also ha ve a temperature dependency, which also may require compensation, depending on the required accuracy class . the compensation for these external error sources may be optionally lumped with the compensation for vref by incorporating their compensation into the ppmc and ppmc2 coefficients for each corresponding channel . the mpu has the responsibility of computing the necessary compensation values requi red for each sensor channel based on the sensed temperature. maxim provides demonstration code that implements the gain_adjn compensation equation shown below. the resulting gain_adjn values are stored by the mpu in three ce ram locations gain_adj0 - gain_adj2 ( ce ram 0x40 - 0x4 2 ). the demonstration code thus provides a suitable implementation of temperature compensation, but other methods are possible in mpu firmware by utilizing the on - chip temperature sensors and the ce ram gain_adjn storage locations. the demonstration code maintains three separate sets of ppmc and ppmc2 coefficients and computes three separate gain_adjn values based on the sensed temperature using the equation below: 23 2 14 2 2 _ 100 2 _ 10 16385 _ ppmc x temp ppmc x temp adj gain ? ? + ? ? + = where, temp_x is the deviation from nominal or calibration temperature expressed in mul tiples of 0.1 c . for example, since the 71m654x calibration (reference) temperature is 22 o c and the measured temperature is 27 o c, then temp_x = (27 - 22) x 10 = 50 (decimal), which represents a +5 o c deviation from 22 o c. table 73 shows the three gain_adjn equation output values and the voltage or current measurements for which they compensate. ? gain_adj0 compensates for the va and vb ( 71m6542f/g only) voltage measurements in the 71m654x and is used to compensate the vref in the 71m654x . the designer may optionally add compensation for the resistive voltage dividers into the ppmc and ppmc2 coefficient s for this channel. ? gain_adj1 provides compensation for the ia current channel and compensates for the 71m654x vref. the designer may optionally add compensation for the shunt or ct and its corresponding signal conditioning circuit into the ppmc and ppmc2 coefficients for this channel. ? gain_adj2 provides compensation for the ib current channel and compensates for the 71m654x vref . the designer may optionally add compensation for the ct and its signal conditioning circuit into the ppmc and ppmc2 coefficients for this channel. table 72 : gain_adjn compensation channels gain adju s tment output ce ram address 71m6541d/f /g 71m6542f/g gain_adj0 0x40 va va, vb gain_adj1 0x41 ia ia gain_adj2 0x42 ib ib in the demonstration code, temperature compensation behavior is determined by the values stored i n the ppmc and ppmc2 coefficients for each of the three channels, which are setup by the mpu demo code at initia lization time from values that are previously stored in eeprom. to disable temperature compensation in the demonstration code, ppmc and ppmc2 are both set to zero for each of the three gain_adjn channels. to enable temperature compensation, the ppmc and p pmc2 coefficients are set with values that match the expected temperature variation of each correspond ing sensor channel. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 99 for vref compensation, both the linear coefficient ppmc and the quadratic coefficient ppmc2 , are determined as described in 4.7.2 temperature coefficients for the 71m654x . the compensation for the external error sources is accomplished by summing the ppmc value associated with vref with the ppmc value associated with the external error source to obtain the final ppmc value for the sensor channel. similarly, the ppmc2 v alue associated with vref is summed with the ppmc2 value associated with the external error source. to determine the contribution of the current shunt sensor or ct to the ppmc and ppmc2 coefficients, the designer must either know the temperature coefficients of the shunt or the ct from its data sheet or obtain them by laboratory measurement. the designer must consider component variation across mass production to ensure that the product will meet its accuracy requirement across production. 4.7.4 temperature compensation for vref with remote sensor this section discusses metrology temperature compensation for the meter designs where current s hunt sensors are used in conjunction with the 71m6x01 isolated sensors, as shown in figure 36 and figure 38 . any sensors that are directly connected to the 71m654x are affected by the voltage variation in the 71m654x vref due to temperature. on the other hand, sensors that are connected to the 71m6x01 isolated sensor , are affected by the vref in the 71m6x01 . th e vref in both the 71m654x and 71m6x01 can be compensated digitally using a second - order polynomial function of temperature. the 71m654x and 71m6x01 feature temperature sensor s for the purposes of temperature compensating their corresponding vref. referring to figure 36 and figure 38 , the va voltage sensor is available in the 71m6541d/f /g and 71m6542f/g and is dir e ctly connected to the 71m654x. the vb voltage sensor is available only in the 71m6542f/g and is also directly connected to it. thus, the precision of these directly connected voltage sensors is affected by vref in the 71m654x. the 71m654x also has one shunt current sensor (ia) which is connected directly to it, and therefore is also affected by the vref in the 7 1m654x. t he external current sensor and its corresponding signal conditioning circuit also has a temperature dependency, which also may require compensation, depending on the required accuracy class . finally, the second current sensor (ib) is isolated by the 71m6x01 and depends on the vref of the 71m6x01 , plus the variation of the corresponding shunt resistance with temperature. the mpu has the responsibility of computing the necessary compensation values requi red for each sensor channel based on the sensed temperature. maxim provides demonstration code that implements the gain_adjn compensation equation shown below. the resulting gain_adjn values are stored by the mpu in three ce ram locations gain_adj0 - gain_adj 2 ( ce ram 0x40 - 0x4 2 ). the demonstration code thus provides a suitable implementation of temperature compensation, but other methods are possible in mpu firmware by utilizing the on - chip temperature sensors and the ce ram gain_adjn storage locations. the demonstration code maintains three separate sets of ppmc and ppmc 2 coefficients and computes three separate gain_adjn values based on the sensed temperature using the equation below: 23 2 14 2 2 _ 100 2 _ 10 16385 _ ppmc x temp ppmc x temp adj gain ? ? + ? ? + = where, temp_x is the deviation from nominal or calibration temperature expressed in mul tiples of 0.1 c . for example, since the 71m654x calibration (reference) temperature is 22 o c and the measured temperature is 27 o c, then temp_x = (27 - 22) x 10 = 50 (decimal), which represents a +5 o c deviation from 22 o c. table 73 shows the three gain_adjn equation output values and the voltage or current measurements for which they compensate. ? gain_adj0 compensates for the va and vb ( 71m6542f/g only) voltage measurements in the 71m654x and is used to compensate the vref in the 71m654x. the designer may optionally add compensation for the resistive voltage dividers into the ppmc and ppmc2 coefficients for this channel. ? gain_adj1 provides compensation for the ia current channel and compensates for the 71m654x vref. the designer may optionally add compensation for the shunt and its corresponding signal conditioning circuit into the ppmc and ppmc2 coefficient s for this channel. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 100 rev 5 ? gain_adj2 provides compensation for the remotely connected ib shunt current sensor and c ompensates for the 71m6x01 vref. the designer may optionally add compensation for the shunt connected to the 71m6x01 into the ppmc and ppmc2 coeffic ients for this channel. table 73 : gain_adjn compensation channels gain adju s tment output ce ram address 71m6541d/f /g 71m6542f/g gain_adj0 0x40 va va , vb gain_adj1 0x41 ia ia gain_adj2 0x42 ib ib in the demonstration code, t emperature compensation behavior is determined by the values stored in the ppmc and ppmc2 coefficients , which are setup by the mpu demo code at initialization time from values that are previously stored in eeprom. to disable temperature compensation in the demonstration code, ppmc and ppmc2 are both set to zero for each of the three gain_adjn channels . to enable temperature compensation, the ppmc and ppmc2 coefficients are set with values that match the expected temperature variation of the corresponding channel. for vref compensation, both the linear coefficient ppmc and the quadratic coefficient ppmc2 , are determined for the 71m654x as described in 4.7.2 temperature coefficients for the 71m654x . for information on determining the ppmc and ppmc2 coefficients for the 71m6x01 vref, refer to the 71m6xxx data sheet. the compensation for the external error sources is accomplished by summing the ppmc value associated with vref with the ppmc value associated with the external error source to obtain the final ppmc value for the sensor channel. similarly, the ppmc2 value associated with vref is summed with the ppmc2 value associated with the external error source. to determine the contribution of the current shunt sensor to the ppmc and ppmc2 coefficients, the designer must either know the temperature coefficients of the shunt from its data sheet or obtain it b y laboratory measurement. the designer must consider component variation across mass production to ensure that the product will meet its accuracy requirement across production. 4.8 connecting i 2 c eeproms i 2 c eeproms or other i 2 c compatible devices should be connected to the dio pins segdio 2 and segdio3 , as shown in figure 39 . pull - up resistors of roughly 10 k ? to v3p3d (to ensure operation in brn mode) should be used for both sdck and s data signals . the dio_eex [1:0] ( i/o ram 0x2456[7:6 ]) field in i/o ram must be set to 01 in order to convert the dio pins segdio2 and segdio3 to i 2 c pins s dck and sdata . figure 39 : i 2 c eeprom connection segdio2/sdck eeprom s d c k sda ta v3p3d 10 k 10 k 71m654x segdio3/sdata downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 101 4.9 connecting three - wire eeproms wire eeproms and other compatible devices should be connected to the dio pins segdio2 /sdck and segdio3/sdata , as described i n 2.5.9 eeprom interface . 4.10 uart0 (tx/rx) the uart0 rx pin should be pulled down by a 10 k ? resistor and additionally protected by a 100 pf ce ramic capacitor, as shown in figure 40 . figure 40 : connections for uart0 4.11 optical interface (uart1) the opt_tx and opt_rx pins can be used for a regular serial interface ( by connecting a rs_232 transceiver for example), or they can be used to directly operate optical components (for example, an infrared diode and phototransistor implementing a flag interface ) . figure 41 shows the basic connections for uart1 . the opt_tx pin becomes active when the i/o ram control field opt_txe ( i/o ram 0x2456[3:2 ]) is set to 01 . the polarity of the opt_tx and opt_rx pins can be inverted with the configuration bits , opt_txinv (i/o ram 0x2456[0]) and opt_rxinv (i/o ram 0x2457[1]) , re spectively . the opt_tx output may be modulated at 38 khz when system power is present . modulation is not available in brn mode . the opt_txmod bit ( i/o ram 0x2456[1]) enables modulation . the duty cycle is controlled by opt_fdc[1:0] (i/o ram 0x2457[5:4] ) , which can select 50%, 25%, 12.5%, and 6.25% duty cycle . a 6.25% duty cycle means opt_tx is low for 6.25% of the period. the opt_rx pin uses digital signal thresholds. it may need an analog filter when receiving modulated optical signals. with modulation, an optical emitter can be operated at higher current than nominal, enabling it to increase th e distance along the optical path. if operation in brn mode is desired, the external components should be connected to v3p3d. however, it is recommended to limit the current to a few ma. tx rx 71m654x 10 k 100 pf rx tx downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 102 rev 5 figure 41 : connection for optical components 4.12 connecting the reset pin even though a functional meter does not necessarily need a reset switch, it is useful to have a reset push button for prototyping as shown in figure 42 , left side. the reset signal may be sourced from v3p3sys (functional in msn mode only), v3p3d ( msn and brn modes), or vbat (all modes, if a battery is present), or from a combination of these sources, depending on the application. for a production meter, the reset pin should be protected by the external components shown in figure 42 , right side. r1 should be in the range of 100 ? and mounted as closely as possible to the ic. s ince the 71m6541d/f /g and 71m6542f/g generate t heir own power - on reset, a reset button or circu itry, as shown in figure 42 , is only required for test units and prototypes. figure 42 : external components for the reset pin: push - button (left), production circuit (right) r 1 reset 71m654x gndd v3p3d r 2 vbat/ v3p3d reset switch 1k ? 0.1f 10k opt_tx r 2 r 1 opt_rx 71m654x v3p3sys phototransistor led 10 k ? 100 pf v3p3sys 71m654x gndd downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 103 4.13 connecting the emulator port pins even when the emulator is not used, small shunt capacitors to ground (22 pf) should be used for protec tion from emi as illustrated in figure 43 . production boards should have the ice_e pin connected to ground. figure 43 : external components for the emulator interface e_rst 71m654x e_tclk 62 62 ? 62 ? 22 pf 22 pf 22 pf lcd segments ice_e v3p3d e_rxt (optional) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 104 rev 5 4.14 flash programming 4.14.1 flash programming via the ice port operational or test code can be programmed into the flash memory using either an in - circuit emulator or the flash programmer module (tfp -2 ) available from maxim . the flash programming procedure uses the e_rst, e_rxtx, and e_tclk pins. 4.14.2 flash programming via the spi port it is possible to erase, read and program the flash memory of th e spi port. see 2.5.10 spi slave port for a detailed description. 4.15 mpu firmware library all application - specific mpu functions mentio ned in 4 a pplication i nformation are featured in the demonstration c source code supplied by m axim . the code is available as part of the demo nstration kit for the 71m6541d/f /g and 71m6542f/g . the demonstrati on kits come with the pre programmed with demo firmware and mounted on a functional sample meter demo board . the demo boards allow for quic k and efficient evaluation of the ic without having to write firmware or having to supply an in - circuit emulator (ice). 4.16 crystal oscillator the oscillator of the 71m6541d/f /g and 71m6542f/g drives a standard 32.768 khz watch crystal. the oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability. the oscillator power dissipation is v ery low to maximize the lifetime of any battery backup device attached to the vbat _rtc pin . board layouts with minimum capacitance from xin to xout require less battery c urrent. good layouts have xin and xout shielded from each other and from lcd and digital signal s. since the oscillator is self - biasing, an external resistor must not be connected across the crystal. 4.17 meter calibration once the 71m654x energy meter device has been installed in a meter system, it must be calibrated . a complete calibration includes the following: ? establishment of the reference temperature (e.g., typ ically 22 ? c) ? calibration of the metrology section, i.e., calibration for tolerances of the current sensors, voltage di viders and signal conditioning components as well as of the internal reference voltage (vref) at the reference temperature (e.g., typically 22 ? c). ? calibration of the oscillator frequency using the rtc a _adj[7:0] i/o ram register ( i/o ram 0x2504 ). the metrology section can be calibrated using the gain and phase adjustment factors accessible to the ce . the gain adjust ment is used to compensate for tolerances of components used for signal conditioning, especially the resistive components . phase adjustment is provided to compensate for phase shifts introduced by the current sensors or by the effects of reactive power supplies . due to the flexibility of the mpu firmware, any calibration method, such as calibration based on energy, or current and voltage can be implemented . it is also possible to implement segment - wise calibration (de pending on current range). the 71m6541d/f /g and 71m6542f/g support common industry standard calibration techniques, such as sin gle - point (energy - only), multi - point (energy, vrms, irms), and auto - calibration. maxim provides a calibration spreadsheet file to facilitate the calibration process. contact yo ur maxim representative to obtain a copy of the latest calibration spreadsheet file for the 71m654x. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 105 5 firmware interface 5.1 i/o ram map C functional order in table 74 and table 75 , u nimplemented (u) and r eserved (r) bits are shaded in light gray . unimplemented bits are identified with a u. unimplemented bits have no memory storage, writing them has no effect, and reading them always returns zero . reser ved bits are identified with an r , and must always be written with a zero . writing values other than zero to reserved bits may have undesirable side effects and must be avoided. n on - volatile bits are shaded in dark gra y. non - volatile bits are backed - up during power failures if the system includes a battery connected to the vbat pin. the i/o ram locations listed in table 74 have sequential addresses to facilitate reading by the mpu (e.g., in order to verify their content s). these i/o ram locations are u sually modified only at boot - up . t he addresses shown in table 74 are an alternative sequential address to the addresses from table 75 which are used th roughout document. for instance, equ[2:0] can be accessed at i/o ram 0x200 0 [7:5] or at i/o ram 0x2106[7:5] . table 74 : i/o ram map C functional order, basic configuration name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ce6 2000 equ[2:0] u chop_e[1:0] rtm_e ce_e ce5 2001 u sum_samps[12:8] ce4 2002 sum_samps[7:0] ce3 2003 u u ce_lctn[5:0] ce2 2004 pls_maxwidth[7:0] ce1 2005 pls_interval[7:0] ce0 2006 r r diffb _e diffa _e rfly_dis fir_len [1:0] pls_inv rce0 2007 chopr[1:0] r r r mt_e r r r rtmux 2008 u tmuxrb[2:0] u tmuxra[2:0] reserved 2009 u u r u u u u u mux5 200a mux_div[3:0] mux10_sel mux4 200b mux9_sel mux8_sel mux3 200c mux7_sel mux6_sel mux2 200d mux5_sel mux4_sel mux1 200e mux3_sel mux2_sel mux0 200f mux1_sel mux0_sel temp 2010 temp_ bsel temp_ pwr osc_comp temp_bat tbyte_busy temp_per[2:0] lcd0 2011 lcd_e lcd_mode[2:0] lcd_allcom lcd_y lcd_clk[1:0] lcd1 2012 lcd_vmode[1:0] lcd_blnkmap23[5:0] lcd2 2013 lcd_bat r lcd_blnkmap22[5:0] lcd_map6 2014 lcd_map[55:48] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 106 rev 5 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd_map5 2015 lcd_map[47:40] lcd_map4 2016 lcd_map[39:32] lcd_map3 2017 lcd_map[31:24] lcd_map2 2018 lcd_map[23:16] lcd_map1 2019 lcd_map[15:8] lcd_map0 201a lcd_map[7:0] dio_r5 201b u u u u u dio_rpb[2:0] dio_r4 201c u dio_r11[2:0] u dio_r10[2:0] dio_r3 201d u dio_r9[2:0] u dio_r8[2:0] dio_r2 201e u dio_r7[2:0] u dio_r6[2:0] dio_r1 201f u dio_r5[2:0] u dio_r4[2:0] dio_r0 2020 u dio_r3[2:0] u dio_r2[2:0] dio0 2021 dio_eex[1:0] u u opt_txe[1:0] opt_txmod opt_txinv dio1 2022 dio_pw dio_pv opt_fdc[1:0] u opt_rxdis opt_rxinv opt_bb dio2 2023 dio_px dio_py u u u u u u int1_e 2024 ex_eex ex_xpulse ex_ypulse ex_rtc t u ex_rtc1m ex_rtc1s ex_xfer int2_e 2025 ex_spi ex_wpulse ex_vpulse u u u u u wake_e 2026 ew_rx ew_pb ew_ dio 4 ew_ dio 52 ? ew_dio 55 sfmm 2080 sfmm[7:0]* sfms 2081 sfms[7:0]* notes: * sfmm and sfms are accessible only through the spi slave port. see invoking sfm (page 77 ) for details. ? 71m6542f/g only. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 107 table 75 lists bits and registers that may have to be accessed on a frequent basis. reserved bits have lighter gray background, and non - volatile bits have a darker gray background. table 75 : i/o ram map C functional order name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ce and adc mux5 2100 mux_div[3:0] mux10_sel[3:0] mux4 2101 mux9_sel[3:0] mux8_sel[3:0] mux3 2102 mux7_sel[3:0] mux6_sel[3:0] mux2 2103 mux5_sel[3:0] mux4_sel[3:0] mux1 2104 mux3_sel[3:0] mux2_sel[3:0] mux0 2105 mux1_sel[3:0] mux0_sel[3:0] ce6 2106 equ[2:0] u chop_e[1:0] rtm_e ce_e ce5 2107 u u u sum_samps[12:8] ce4 2108 sum_samps[7:0] ce3 2109 u u ce_lctn[5:0] ce2 210a pls_maxwidth[7:0] ce1 210b pls_interval[7:0] ce0 210c r r diffb _e diffa _e rfly_dis fir_len [1:0] pls_inv rtm0 210d u u u u u u rtm0[9:8] rtm0 210e rtm0[7:0] rtm1 210f rtm1[7:0] rtm2 2110 rtm2[7:0] rtm3 2111 rtm3[7:0] clock generation ckgn 2200 u u adc_div pll_fast reset mpu_div[2:0] lcd/dio vref trim fuses trimt 2309 trimt[7:0] lcd/dio lcd0 2400 lcd_e lcd_mode[2:0] lcd_allcom lcd_y lcd_clk[1:0] lcd1 2401 lcd_vmode[1:0] lcd_blnkmap23[5:0] lcd2 2402 lcd_bat r lcd_blnkmap22[5:0] lcd_map6 2405 lcd_map[55:48] lcd_map5 2406 lcd_map[47:40] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 108 rev 5 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd_map4 2407 lcd_map[39:32] lcd_map3 2408 lcd_map[31:24] lcd_map2 2409 lcd_map[23:16] lcd_map1 240a lcd_map[15:8] lcd_map0 240b lcd_map[7:0] lcd4 240c u u u u u lcd_rst lcd_blank lcd_on lcd_dac 240d u u u lcd_dac[4:0] segdio0 2410 u u lcd_seg0[5:0] u u segdio15 241f u u lcd_seg15[5:0] segdio16 2420 u u lcd_segdio16[5:0] u u segdio45 243d u u lcd_segdio45[5:0] segdio46 243e u u lcd_seg46[5:0] u u segdio50 2442 u u lcd_seg50[5:0] segdio51 2443 u u lcd_segdio51[5:0] u u segdio55 2447 u u lcd_segdio55[5:0] dio_r5 2450 u u u u u dio_rpb[2:0] dio_r4 2451 u dio_r11[2:0] u dio_r10[2:0] dio_r3 2452 u dio_r9[2:0] u dio_r8[2:0] dio_r2 2453 u dio_r7[2:0] u dio_r6[2:0] dio_r1 2454 u dio_r5[2:0] u dio_r4[2:0] dio_r0 2455 u dio_r3[2:0] u dio_r2[2:0] dio0 2456 dio_eex[1:0] u u opt_txe[1:0] opt_txmod opt_txinv dio1 2457 dio_pw dio_pv opt_fdc[1:0] u opt_rxdis opt_rxinv opt_bb dio2 2458 dio_px dio_py u u u u u u nv bits reserved 2500 u u u u r r r r reserved 2501 u u r u u u u u tmux 2502 u u tmux[5 :0] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 109 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmux2 2503 u u u tmux2[4:0] rtc1 2504 u rtca_adj[6:0] 71m6x01 i nterface remote2 2602 rmt_rd[15:8] remote1 2603 rmt_rd[7:0] rbits int1_e 2700 ex_eex ex_xpulse ex_ypulse ex_rtc t u ex_rtc1m ex_rtc1s ex_xfer int2_e 2701 ex_spi ex_wpulse ex_vpulse u u u u u secure 2702 flsh_unlock[3:0] r flsh_rde flsh_wre r analog0 2704 vref_cal vref_dis pre_e adc_e bcurr spare[2:0] version 2706 version[7:0] intbits 2707 u int6 int5 int4 int3 int2 int1 int0 flag0 sfr e8 ie_eex ie_xpulse ie_ypulse ie_rtc t u ie_rtc1m ie_rtc1s ie_xfer flag1 sfr f8 ie_spi ie_wpulse ie_vpulse u u u u pb_state stat sfr f9 u u u pll_ok u vstat[2:0] remote0 sfr fc perr_rd perr_wr rcmd[4:0] spi1 sfr fd spi_cmd[7:0] spi0 2708 spi_stat[7:0] rce0 2709 chopr[1:0] r r rmt_e r r r rtmux 270a u r r r u tmuxra[2:0] dio3 270c u u port_e spi_e spi_safe u u u nv ram and rtc nvramxx 2800 - 287f nvram[0] C nvram[7f] C direct access wake 2880 wake_tmr[7:0] stemp1 2881 stemp[10:3] stemp0 2882 stemp[2:0] u u u u u bsense 2885 bsense[7:0] lkpaddr 2887 lkpautoi lkpaddr[6:0] lkpdata 2888 lkpdat[7:0] lkpctrl 2889 u u u u u u lkp_rd lkp_wr rtc0 2890 rtc_wr rtc_rd u rtc_fail u u u u rtc2 2892 rtc_sbsc[7:0] downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 110 rev 5 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rtc3 2893 u u rtc_sec[5:0] rtc4 2894 u u rtc_min[5:0] rtc5 2895 u u u rtc_hr[4:0] rtc6 2896 u u u u u rtc_day[2:0] rtc7 2897 u u u rtc_date[4:0] rtc8 2898 u u u u rtc_mo[3:0] rtc9 2899 rtc_yr[7:0] rtc10 289b u u u u u rtc_p[16:14] rtc11 289c rtc_p[13:6] rtc12 289d rtc_p[5:0] rtc_q[1:0] rtc13 289e u u rtc_tmin[5:0] rtc14 289f u u u rtc_thr[4:0] temp 28a0 temp_bsel temp_pwr osc_comp temp_bat tbyte_busy temp_per[2:0] wf1 28b0 wf_cstart wf_rst wf_rstbit wf_ovf wf_erst wf_badvdd u u wf2 28b1 u u wf_tmr wf_rx wf_pb wf_ dio 4 wf_ dio 52 wf_ dio 55 misc 28b2 sleep lcd_only wake_arm u u u u u wake_e 28b3 u u u ew_rx ew_pb ew_ dio 4 ew_ dio 52 ? ew_ dio 55 wdrst 28b4 wd_rst temp_start u u u u u u mpu ports p3 sfr b0 dio_dir[15:12] dio[15:12] p2 sfr a0 dio_dir[11:8] dio[11:8] p1 sfr 90 dio_dir[7:4] dio[7:4] p0 sfr 80 dio_dir[3:0] dio[3:0] flash erase sfr 94 flsh_erase[7:0] flshctl sfr b2 preboot secure u u flsh_pend flsh_pstwr flsh_meen flsh_pwe fl_bank sfr b6 u u u u u u fl_bank[1:0] pgadr sfr b7 flsh_pgadr[ 5 :0] u u i 2 c eedata sfr 9e eedata[7:0] eectrl sfr 9f eectrl[7:0] ? 71m6542f/g only downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 111 5.2 i/o ram map C alphabetical order table 76 lists i/o ram bits and registers in alphabetical order. bits with a write direction (w in column dir) are written by the mpu into configuration ram. typically, they are initially stored in flash memory and copied to the configuration ram by the mpu. some of the more frequently programmed bits are mapped to the mpu sfr memory space. the remaining bits are mapped to the address space 0x2xxx. bits with r (read) direction can be read by the mpu. colum ns labeled rst and wk describe the bit values upon reset and wake, respectively. no entry in one of these columns means the bit is either read - only or is powered by the nv supply and is not initia lized. write - only bits return zero when they are read. locations that are shaded in grey are non - volatile (i.e., battery - backed). table 76 : i/o ram map C functional order name location rst wk dir description adc_e 2704[4] 0 0 r/w enables adc and vref. when disabled, reduces bias current . adc_div 2200[5] 0 0 r/w adc_div c ontrols the rate of the adc and fir clocks. the adc_div setting determines whether mck is divided by 4 or 8: 0 = mck/4 1 = mck/8 the resulting adc and fir clock is as shown below. pll_fast = 0 pll_fast = 1 mck 6.291456 mhz 19.660800 mhz adc_div = 0 1.572864 mhz 4.9152 mhz adc_div = 1 0.786432 mhz 2.4576 mhz bcurr 2704[3] 0 0 r/w connects a 100 a load to the battery selected by temp_bsel . bsense[7:0] 2885[7:0] C C r the result of the battery measurement. see 2.5.6 71m654x battery monitor . ce_e 2106[0] 0 0 r/w ce enable. ce_lctn[5:0] 2109[5:0] 31 31 r/w ce program location. the starting address for the ce program is 1024* ce_lctn . chip_id[15:8] chip_id[7:0] 2300[7:0] 2301[7:0] 0 0 0 0 r r these bytes contain the chip identification . chop_e[1:0] 2106[3:2] 0 0 r/w chop enable for the reference bandgap circuit. the value of chop change s on the rising edge of muxsync according to the value in chop_e : 00 = toggle 1 01 = positive 10 = reversed 11 = toggle 1 except at the mux sync edge at the end of an accumulation interval . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 112 rev 5 name location rst wk dir description chopr[1:0] 2709[7:6] 00 00 r/w the chop settings for the remote sensor. 00 = auto chop. change every mux frame. 01 = positive 10 = negative 11 = auto chop. same as 00. diffa _e 210c[4 ] 0 0 r/w enables differential configuration for the ia current input ( iap - ian ). diffb _e 210c[5 ] 0 0 r/w enables differential configuration for the ib current input ( ibp - ibn ). dio_r2[2:0] dio_r3[2:0] dio_r4[2:0] dio_r5[2:0] dio_r6[2:0] dio_r7[2:0] dio_r8[2:0] dio_r9[2:0] dio_r10[2:0] dio_r11[2:0] dio_rpb[2:0] 2455[2:0] 2455[6:4] 2454[2:0] 2454[6:4] 2453[2:0] 2453[6:4] 2452[2:0] 2452[6:4] 2451[2:0] 2451[ 6: 4] 2450[ 2: 0] 0 0 0 0 0 0 0 0 0 0 0 C r/w connects pb and dedicated i/o pins dio2 through dio11 to internal resources . if more than one input is connected to the same resource, the multiple column below specifies how they are combined. dio_rx resource multiple 0 none C 1 reserved or 2 t0 (timer0 clock or gate) or 3 t1 (timer1 clock or gate) or 4 io interrupt (int0) or 5 io interrupt (int1) or dio_dir[15:12] dio_dir[11:8] dio_dir[7:4] dio_dir[3:0] sfr b0[7:4] sfr a0[7:4] sfr 90[7:4] sfr 80[7:4] f f r/w programs the direction of the first 16 dio pins. 1 indicates output. ignored if the pin is not configured as i/o. see dio_pv and dio_pw for special option for the segdio0 and seg dio1 outputs. see dio_eex for special option for seg dio2 and segdio3. note that the direction of dio pins above 15 is set by segdiox[1]. see port_e to avoid power - up spikes. dio[15:12] dio[11:8] dio[7:4] dio[3:0] sfr b0[3:0] sfr a0[3:0] sfr 90[3:0] sfr 80[3:0] f f r/w the value on the first 16 dio pins. pins configured as lcd read s zero. when written, changes data on pins configured as outputs. pins configured as lcd or input ignore writes. note that the data for dio pins above 15 is set by segdiox[0] . dio_eex[1:0] 2456[7:6] 0 C r/w when set, converts pins segdio3 / seg dio2 to interface with external eeprom. segdio2 becomes sdck and segdio3 becomes bi - directional sdata, but only if lcd_map[2] and lcd_map[3] are cleared. dio_eex[1:0] function 00 disable eeprom interface 01 2- wire eeprom interface 10 3- wire eeprom interface 11 3- wire eeprom interface with separate do (dio3) and di (dio8) pins. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 113 name location rst wk dir description dio_pv 2457[6] 0 C r/w causes varpulse to be output on pin seg dio1, if lcd_map[1] = 0. dio_pw 2457[7] 0 C r/w causes wpulse to be output on pin seg dio0, if lcd_map[0] = 0. dio_px 2458[7] 0 C r/w causes xpulse to be output on pin seg dio6 , if lcd_map[6] = 0. dio_py 2458[6] 0 C r/w causes ypulse to be output on pin seg dio7 , if lcd_map[7] = 0. eedata[7:0] sfr 9e 0 0 r/w serial eeprom interface data . eectrl[7:0] sfr 9f 0 0 r/w serial eeprom interface control . status bit name read/ write reset state polarity description 7 error r 0 positive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 positive 1 indicates that the eeprom sent an ack bit. equ[2:0] 2106[7:5] 0 0 r/w specifies the power equation. equ watt & var formula ( wsum/varsum ) inputs used for energy/current calculation w0sum/ var0sum w1sum/ var1sum i0sq sum i1sq sum 0 va* ia 1 element, 2w 1 f va*ia va*ib 1 ia ib 1 1 va*(ia - ib)/2 1 element, 3w 1 f va*(ia - ib)/2 C ia - ib ib 2 ? va*ia + vb*ib 2 element, 3w 3 f delta va*ia vb*ib ia ib note: 1. optionally, ib may be used to measure neutral current. ? 71m6542f/g only downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 114 rev 5 name location rst wk dir description ex_xfer ex_rtc1s ex_rtc1m ex_rtc t ex_spi ex_eex ex_xpulse ex_ypulse ex_wpulse ex_vpulse 2700[0] 2700[1] 2700[2] 2700[3] 2701[7] 2700[7] 2700[6] 2700[5] 2701[6] 2701[5] 0 0 r/w interrupt enable bits. these bits enable the xfer_busy, the rtc_1sec, etc. the bits are set by hardware and cannot be set by writing a 1. the bits are reset by writing 0. note that if one of these interrupts is to enabled, its corresponding 8051 ex enable bit must also be set. see 2.4.8 interrupt s for de tails. ew_dio 4 28b3[2] 0 C r/w connects seg dio4 to the wake logic and permits seg dio4 rising to wake the part. this bit has no effect unless dio4 is configured as a digital input. ew_dio 52 28b3[1] 0 C r/w connects seg dio52 to the wake logic and permits seg dio52 rising to wake the part. this bit has no effect unless seg dio52 is configured as a digital input. th e segdio52 pin is only available in the 71m6542f/g . ew_dio 55 28b3[0] 0 C r/w connects seg dio55 to the wake logic and permits seg dio55 rising to wake the part. this bit has no effect unless seg dio55 is configured as a digital input. ew_pb 28b3[3] 0 C r/w connects pb to the wake logic and permits a high level on pb to wake the part. pb is always configured as an input. ew_rx 28b3[4] 0 C r/w connects rx to the wake logic and permits rx rising to wake the part. see the wake description on page 87 for de - bounce issues. fir_len [1:0] 210c[2:1] 0 0 r/w determines t he number of adc cycles in the adc decimation fir filter. pll_fast = 1: fir_len[1:0] adc cycles 00 141 01 288 10 384 pll_fast = 0: fir_len[1:0] adc cycles 00 135 01 276 10 not allowed the adc lsb size and full - scale values depend on the fir_len[1:0] setting. refer to 6.4.15 adc converter on page 150 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 115 name location rst wk dir description fl_bank sfr b6 01 01 r/w flash bank selection (71m6541g and 71m6542g only) the program memory of the 71m6541g/71m6542g consists of a fixed lower bank of 32 kb, addressable at 0x0000 to 0x7fff plus an upper banked area of 32 kb, addressable at 0x8000 to 0xffff. the i/o ram register fl_bank is used to switch one of four memory banks of 32 kb each into the address range from 0x8000 to 0xffff. note that when fl_bank = 0, the upper bank is the same as the lower bank. fl_bank [1:0] address range for lower bank (0x0000 - 0x7fff) address range for upper bank (0x8000 - 0xffff) 00 0x0000 - 0x7fff 0x00000 - 0x07fff 01 0x0000 - 0x7fff 0x08000 - 0x0ffff 10 0x0000 - 0x7fff 0x10000 - 0x17fff 11 0x0000 - 0x7fff 0x18000 - 0x1ffff flsh_erase[7:0] sfr 94[7:0] 0 0 w flash erase initiate flsh_erase is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are expected for flsh_erase in order to in itiate the appropriate erase cycle. (default = 0x00). 0x55 = initiate flash page erase cycle. must be proceeded by a write to flsh_pgadr [5 :0] ( sfr 0xb7[7: 2] ). 0xaa = initiate flash mass erase cycle. must be proceeded by a write to flsh_meen and the ice port must be enabled. any other pattern written to flsh_erase ha s no effect. flsh_meen sfr b2[1] 0 0 w mass erase enable 0 = mass erase disabled (default). 1 = mass erase enabled. must be re - written for each new mass erase cycle. flsh_pend sfr b2[3] 0 0 r indicates that a timed flash write is pending. if another flash write is attempted , it is ignored. flsh_pgadr[ 5 :0] sfr b7[7: 2] 0 0 w flash page erase address flsh_pgadr[ 5 :0] C flash page address (page 0 thru 63 ) that is erased during the page erase cycle. (default = 0x00). must be re - written for each new page erase cycle. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 116 rev 5 name location rst wk dir description flsh_pstwr sfr b2[2] 0 0 r/w enables timed flash writes. when 1, and if ce_e = 1, flash write requests are sto red in a one - element deep fifo and are executed when ce_busy falls. flsh_pend can be read to determine the status of the fifo. if flsh_pstwr = 0 or if ce_e = 0, flash writes are immediate. flsh_pwe sfr b2[0] 0 0 r/w program write enable 0 = movx commands refer to external ram space, normal operation (default) . 1 = movx @ dptr ,a moves a to external program space (flash) @ dptr . this bit is automatically reset after each byte written to flash. writes to this bit are inhibited when interrupts are enabled. flsh_rde 2702[2] C C r indicates that the flash may be read by ice or spi slave. flsh_rde = (! secure ) flsh_unlock[3:0] 2702[7:4] 0 0 r/w must be a 2 to enable any flash modification. see the description of flash security for more details. flsh_wre 2702[1] C C r indicates that the flash may be written through ice or spi slave ports. ie_xfer ie_rtc1s ie_rtc1m ie_rtc t ie_spi ie_eex ie_xpulse ie_ypulse ie_wpulse ie_vpulse sfr e8[0] sfr e8[1] sfr e8[2] sfr e8[4] sfr f8[7] sfr e8[7] sfr e8[6] sfr e8[5] sfr f8[ 6] sfr f8[ 5] 0 0 r/w interrupt flags for external interrupts 2 and 6. these flags monitor the source of the int6 and int2 interrupts (external interrupts to the mpu core) . the se flags are set by hardware and must be cleared by the software interrupt hand ler. the iex2 ( sfr 0xc0[1] ) and iex6 ( sfr 0xc0[5] ) interrupt flags are automatically cleared by the mpu core when it vectors to the interrupt handler. iex2 and iex6 must be cleared by writing zero to their corresponding bit positions in sfr 0xc0, while wri ting ones to the other bit positions that are not being cleared. intbits 2707[6:0] C C r i nterrupt inputs. the mpu may read these bits to see the input to external inter rupts int0, int1, up to int6. these bits do not have any memory and are primarily intended for debug use. lcd_allcom 2400[3] 0 C r/w configures seg/com bits as com. has no effect on pins whose lcd_map bit is zero. lcd_bat 2402[7] 0 C r/w connects the lcd power supply to vbat in all modes. lcd_blnkmap23[5:0 ] lcd_blnkmap22[5:0] 2401[5:0] 2402[5:0] 0 C r/w identifies which segments connected to seg23 and seg22 should blink. 1 means blink. the most significant bit corresponds to com5, the least significant , to com0. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 117 name location rst wk dir description lcd_clk[1:0] 2400[1:0] 0 C r/w sets the lcd clock frequency. note: f w = 32768 hz lcd_clk lcd clock frequency lcd_clk lcd clock frequency 00 9 2 w f = 64 hz 10 7 2 w f = 256 hz 01 8 2 w f = 128 hz 11 6 2 w f = 512 hz lcd_dac[4:0] 240d[4:0] 0 C r/w the lcd contrast dac. this dac controls the vlcd voltage and has an output range of 2.5 v to 5 v. the vlcd voltage is vlcd = 2.5 + 2.5 * lcd_dac[4:0]/ 31 thus, the lsb of the dac is 80.6 mv. the maximum dac output voltage is li mited by v3p3sys, vbat, and whether lcd_bste = 1. lcd_e 2400[7] 0 C r/w enables the lcd display. when disabled, vlc2, vlc1, and vlc0 are ground as are the com and seg outputs if their lcd_map bit is 1. lcd_map[55:48] lcd_map[47:40] lcd_map[39:32] lcd_map[31:24] lcd_map[23:16] lcd_map[15:8] lcd_map[7:0] 2405[7:0] 2406[7:0] 2407[7:0] 2408[7:0] 2409[7:0] 240a[7:0] 240b[7:0] 0 0 0 0 0 0 0 C C C C C C C r/w r/w r/w r/w r/w r/w r/w enables lcd segment driver mode of combined segdio pins. pins that cannot be configured as outputs (seg48 through seg50) become inputs with internal pull ups when their lcd_map bit is zero. also, note that seg48 through seg50 are multiplexed with the in - circuit emulator signals. when the ice_e pin is high, the ice interface is enabled, and seg48 through seg50 become e_rxtx, e_tclk and e_rst, respectively. lcd_mode[2:0] 2400[6:4] 0 C r/w selects t he lcd bias and multiplex mode. lcd_mode output lcd_mode output 000 4 states, 1/3 bias 100 static display 001 3 states, 1/3 bias 101 5 states, 1/3 bias 010 2 states, ? bias 110 6 states, 1/3 bias 011 3 states, ? bias lcd_on lcd_blank 240c[0] 240c[1] 0 0 C C r/w r/w turns on or off all lcd segments without changing lcd data. if both bits are set, the lcd display is turned on. lcd_only 28b2[6] 0 0 w puts the ic to sleep, but with lcd display still active. ignored if system power is pr esent. it awaken s when wake t imer times out, when certain dio pins are raised, or when system power returns. see 3.2 battery modes . lcd_rst 240c[2] 0 C r/w clear all bits of lcd data. these bits affect segdio pins that are configured as lcd drivers. this bit does not auto clear. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 118 rev 5 name location rst wk dir description lcd_seg0[5:0] to lcd_seg15[5:0] 2410[5:0] to 241f[5:0] 0 C r/w seg data for seg0 through seg15. dio data for these pins is in sfr space. lcd_segdio16[5:0] to lcd_segdio45[5:0] 2420[5:0] to 243d[5:0] 0 C r/w seg and dio data for segdio16 through segdio45. if configured as dio, bit 1 is direction (1 is output, 0 is input), bit 0 is data, and the other bits are ignored. lcd_seg46[5:0] to lcd_seg50[5:0] 243e[5:0] to 2442[5:0] 0 C r/w seg data for seg46 through seg50. these pins cannot be configured as dio. lcd_segdio51[5:0] to lcd_segdio55[5:0] 2443[5:0] to 2447[5:0] 0 C r/w seg and dio data for segdio51 through segdio55. if configured as dio, bit 1 is direction (1 is output, 0 is input), bit 0 is data, and the other bits are ignored. segdio52 through sedio54 are available only on the 71m6542f/g . lcd_vmode[1:0] 2401[7:6] 00 00 r/w specifies how vlcd is generated. see 2.5.8.4 for the definition of v3p3l. lcd_vmode description 11 external vlcd 10 lcd boost and lcd dac enabled 01 lcd dac enabled 00 no boost and no dac. vlcd=v3p3l. lcd_y 2400[2] 0 C r/w lcd blink frequency (ignored if blink is disabled). 1 = 1 hz, 0 = 0.5 hz lkpaddr[6:0] 2887[6:0] 0 0 r/w the address for reading and writing the rtc lookup ram lkpautoi 2887[7] 0 0 r/w auto - increment flag. when set, lkpaddr auto - increment s every time lkp_rd or lkp_wr is pulsed. the incremented address can be read at lkpaddr[6:0]. lkpdat[7:0] 2888[7:0] 0 0 r/w the data for reading and writing the rtc lookup ram. lkp_rd lkp_wr 2889[1] 2889[0] 0 0 0 0 r/w r/w strobe bits for the rtc lookup ram read and write. when set, the lkpaddr[6:0] field and lkpdat register is used in a read or write op eration. when a strobe is set, it stay s set until the operation completes, at which time the strobe is cleared and lkpaddr[6:0] is incremented if the lkpautoi bit is set. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 119 name location rst wk dir description mpu_div[2:0] 2200[2:0] 0 0 r/w mpu clock rate is: mpu rate = mck rate * 2 - (2+ mpu_div [2:0]) . the maximum value for mpu_div[ 2:0] is 4 . based on the default values of the pll_fast bit and mpu_div[ 2:0 ] , the power up mpu rate is 6.29 mhz / 4 = 1.5725 mhz. the minimum mpu clock rate is 38.4 khz when pll_fas t = 1. mux0_sel[3:0] 2105[3:0] 0 0 r/w selects which adc input is to be converted during time slot 0. mux1_sel[3:0] 2105[7:4] 0 0 r/w selects which adc input is to be converted during time slot 1. mux2_sel[3:0] 2104[3:0] 0 0 r/w selects which adc input is to be converted during time slot 2. mux3_sel[3:0] 2104[7:4] 0 0 r/w selects which adc input is to be converted during time slot 3. mux4_sel[3:0] 2103[3:0] 0 0 r/w selects which adc input is to be converted during time slot 4. mux5_sel[3:0] 2103[7:4] 0 0 r/w selects which adc input is to be converted during time slot 5. mux6_sel[3:0] 2102[3:0] 0 0 r/w selects which adc input is to be converted during time slot 6. mux7_sel[3:0] 2102[ 7:4] 0 0 r/w selects which adc input is to be converted during time slot 7. mux8_sel[3:0] 2101[3:0] 0 0 r/w selects which adc input is to be converted during time slot 8. mux9_sel[3:0] 2101[ 7:4] 0 0 r/w selects which adc input is to be converted during time slot 9. mux10_sel[3:0] 2100[3:0] 0 0 r/w selects which adc input is to be converted during time slot 10. mux_div[3:0] 2100[7:4] 0 0 r/w mux_div [3:0] is the number of adc time slots in each mux frame. the maximum number of time slots is 11. opt_bb 2457[0] 0 C r/w configures the input of the optical port to be a dio pin to allow it to be bit - banged. in this case, dio5 becomes a third high speed uart. refer to 2.5.7 uart and optical interface under the bit banged optical uart (third uart ) sub - heading on page 58 . opt_fdc[1:0] 2457[5:4] 0 C r/w selects opt_tx modulation duty cycle . opt_fdc function 00 50% low 01 25% low 10 12.5% low 11 6.25% low opt_rxdis 2457[2] 0 C r/w opt_rx can be configured as an input to the optical uart or as segdio55. opt_rxdis = 0 and lcd_map[55] = 0: opt_rx opt_rxdis = 1 and lcd_map[55] = 0: dio55 opt_rxdis = 0 and lcd_map[55] = 1: seg55 opt_rxdis = 1 and lcd_map[55] = 1: seg55 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 120 rev 5 name location rst wk dir description opt_rxinv 2457[1] 0 C r/w inverts result from opt_rx comparator when 1. affects only the uart input. has no effect when opt_rx is used as a dio input. opt_txe [1: 0] 2456[3:2] 00 C r/w configures the opt_tx output pin. if lcd_map[51] = 0: 00 = dio51, 01 = opt_tx, 10 = wpulse, 11 = varpulse if lcd_map[51] = 1: xx = seg51 opt_txinv 2456[0] 0 C r/w invert opt_tx when 1. this inversion occurs before modulation. opt_txmod 2456[1] 0 C r/w enables modulation of opt_tx. when opt_txmod is set, opt_tx is modulated when it would otherwise have been zero. the modulation is applied after any inversion caused by opt_txinv . osc_comp 28a0[5] 0 C r/w enables the automatic update of rtc_p and rtc_q every time the temperature is measured. pb_state sfr f8[0] 0 0 r the de - bounced state of the pb pin. perr_rd perr_wr sfr fc[6] sfr fc[5] 0 0 r/w the ic sets these bits to indicate that a parity error on the remote sensor has been detected. once set, the bits are remembered until they are cleared by the mpu. pll_ok sfr f9[4] 0 0 r indicates that the clock generation pll is settled. pll_fast 2200[4] 0 0 r/w controls the speed of the pll and mck. 1 = 19.66 mhz (xtal * 600) 0 = 6.29 mhz (xtal * 1 92 ) p ls_ maxwidth [7:0] 210a[7:0] ff ff r/w pls_maxwidth[7:0] d etermines the maximum width of the pulse (low - going pulse if pls_inv =0 or high - going pulse if pls_inv =1 ). the m aximum pulse width is (2* pls_maxwidth [7:0] + 1)*t i . where t i is pls_interval [7:0] in units of ck_fir clock cycles. if pls_interval [7:0] = 0 or pls_maxwidth [7:0] = 255, no pulse width checking is performed and the output pulses have 50% duty cycle. see 2.3.6.2 vpulse and wpulse . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 121 name location rst wk dir description pls_interval[7:0] 210b[7:0] 0 0 r/w pls_interval[7:0] d etermines the i nterval time between pulses. the time between output pulses is pls_interval [7:0] *4 in units of ck_fir clock cycles . if pls_interval [7:0] = 0, the fifo is not used and pulses are output as soon as the ce issues them. pls_interval[7:0] is calculated as follows: pls_interval[7:0] = f loor ( mux frame duration in ck_fir cycles / ce pulse updates per mux frame / 4 ) for example, since the 71m654 x ce code is written to generate 6 pulses in one integration interval, w hen the fifo is enabled (i.e., pls_interval [7:0] 0) and that the frame duration is 1950 ck_fir clock cycles, pls_interval[7:0] should be written with floor(1950 / 6 / 4) = 81 so that the five pulses are evenly spaced in time over the integration interval and the last pulse is issued just prior to the end of the interval . see 2.3.6.2 vpulse and wpulse . pls_inv 210c[0] 0 0 r/w inverts the polarity of wpulse , varpulse , xpulse and ypulse . normally, these pulses are active low. when inverted, they become active high. port_e 270c[5] 0 0 r/w enables outputs from the pins seg dio0 - seg dio15. port_e = 0 after reset and power - up blocks the momentary output pulse that would occur on seg dio0 to segdio15 . pre_e 2704[5] 0 0 r/w enables the 8x pre - amp lifier . preboot sfrb2[7] C C r indicates that pre - boot sequence is active. rcmd[4:0] sfr fc[4:0] 0 0 r/w w hen the mpu writes a non - zero value to rcmd[4:0] , the ic issues a command to the appropriate remote sensor. when the command is complete, the ic clears rcmd [4:0] . reset 2200[3] 0 0 w when set, writes a one to wf_rstbit and then causes a reset. rfly_dis 210c[3] 0 0 r/w controls how the ic drives the power pulse for the 71m6x01 . when set, the power pulse is driven high and low. when cleared, it is driven high followed by an open circuit fly - back interval. rmt_e 2709[ 3] 0 0 r/w enables the remote digital isolation interface , which transforms the ibp - ibn pins into a digital balanced differential pair. thus, enabling these pins to interface to the 71m6x01 isolated se n sor. rmt_rd[15:8] rmt_rd[7:0] 2602[7:0] 2603[7:0] 0 0 r response from remote read request. rtc_fail 2890[4] 0 0 r indicates that a count error has occurred in the rtc and that the time is not trustworthy. this b it can be cleared by writing a 0 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 122 rev 5 name location rst wk dir description rtc_p[16:14] rtc_p[13:6] rtc_p[5:0] 289b[2:0] 289c[7:0] 289d[7:2] 4 0 0 4 0 0 r/w rtc adjust. see 2.5.4 real - time clock (rtc) . 0x0ffbf rtc_p 0x10040 note: rtc_p[16:0] and rtc_q[1:0] form a single 19 - bit rtc adjustment value. rtc_q[1:0] 289d[1:0] 0 0 r/w rtc adjust. see 2.5.4 real - time clock (rtc) . note: rtc_p[16:0] and rtc_q[1:0] form a single 19 - bit rtc adjustment value. rtc_rd 2890[6] 0 0 r/w freezes the rtc shadow register so it is suitable for mpu reads. when rtc_rd is read, it returns the status of the shadow register: 0 = up to date, 1 = frozen. rtc_sbsc[7:0] 2892[7:0] C C r time remaining until the next 1 second boundary. lsb = 1/128 second. rtc_tmin[5:0] 289e[5:0] 0 C r/w the target minutes register. see rtc_thr below. rtc_thr[4:0] 289f[4:0] 0 C r/w the target hours register. the rtc_t interrupt occur s when rtc_min be comes equal to rtc_tmin and rtc_hr becomes equal to rtc_thr . rtc_wr 2890[7] 0 0 r/w freezes the rtc shadow register so it is suitable for mpu writes. when rtc_wr is cleared, the contents of the shadow register are written to the rtc counter on the next rtc clock (~ 500 hz). when rtc_wr is read, it return s 1 as long as rtc_wr is set. it continue s to return one until the rtc counter actually updates. rtc_sec[5:0] rtc_min[5:0] rtc_hr[4:0] rtc_day[2:0] rtc_date[4:0] rtc_mo[3:0] rtc_yr[7:0] 2893[5:0] 2894[5:0] 2895[4:0] 2896[2:0] 2897[4:0] 2898[3:0] 2899[7:0] C C C C C C C C C C C C C C r/w the rtc interface registers. these are the year, month, day, hour, minute and second parameters for the rtc. the rtc is set by writing to these regis ters. year 00 and all others divisible by 4 are defined as a leap year. sec 00 to 59 min 00 to 59 hr 00 to 23 (00 = midnight) day 01 to 07 (01 = sunday) date 01 to 31 mo 01 t o 12 yr 00 to 99 each write operation to one of these registers must be preceded by a write to 0x 2 890 . rtc a _adj[6:0] 2504[7:0] 40 C r/w analog rtc frequency adjust register . rtm_e 2106[1] 0 0 r/w real time monitor enable. when 0, the rtm output is low. rtm0[9:8] rtm0[7:0] rtm1[7:0] rtm2[7:0] rtm3[7:0] 210d[1:0] 210e[7:0] 210f[7:0] 2110[7:0] 2111[7:0] 0 0 0 0 0 0 0 0 0 0 r/w four rtm probes. before each ce code pass, the values of these registers are serially output on the rtm pin. the rtm registers are ignored when rtm_e = 0. note that rtm0 is 10 bits wide. the others assume the upper two bits are 00. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 123 name location rst wk dir description secure sfr b2[6] 0 0 r/w i nhibits erasure of page 0 and flash addresses above the beginning of ce code as defined by ce_lctn[5:0]. also inhibits the read of flash via the spi and ice port. sleep 28b2[7] 0 0 w puts the part to slp mode. ignored if system power is present. the part wake s when the wake timer times out, when push button is pushed, or when system power returns. spi_cmd [7:0] sfr fd[7:0] C C r spi command register for the 8- bit command from the bus master. spi_e 270c[4] 1 1 r/w spi port enable. enables spi interface on pins segdio36 C segdio39. re quires that lcd_map[36 - 39] = 0. spi_safe 270c[3] 0 0 r/w limits spi writes to spi_cmd and a 16 - byte region in dram. no other writes are permitted. spi_stat [7:0] 2708[7:0] 0 0 r spi_stat contains the status results from the previous spi transaction . bit 7 : r eady error: t he 71m654x was not ready to read or write as directed by the previous command. bit 6 : read data parity: this bit is the parity of all bytes read from the 71m654x in the previous command. does not include the spi_stat byte. bit 5: write data parity: this bit is the overall parity of the bytes written to the 71m654x in the pre vious command. it includes cmd and addr bytes. bit 4 - 2: bottom 3 bits of the byte count. does not include addr and cmd bytes. one, two, and three byte in structions return 111. bit 1: spi flash mode: this bit is zero when the test pin is zero. bit 0 : spi flash mode ready: used in spi flash mode. indicates that the flash is ready to receive another write instruction. stemp[10:3] stemp[2:0] 2881[7:0] 2882[7:5] C C C C r r the result of the temperature measurement. sum_samps[12:8] sum_samps[7:0] 2107[4:0] 2108[7:0] 0 0 r/w the number of mu ltiple x er cycles per xfer_busy interrupt. maximum value is 8191 cycles. tbyte_busy 28a0[3] 0 0 r indicates that hardware is still writing the 0x 28a0 byte. additional writes to this byte are locked out while it is one. write duration could be as long as 6ms. temp_22[10:8] temp_22[7:0] 230a[2:0] 230b[7:0] 0 C r storage location for stemp at 22c. stemp is an 11 - bit word. temp_bat 28a0[4] 0 C r/w causes vbat to be measured whenever a temperature measurement is performed. temp_bsel 28a0[ 7] 0 C r/w selects which battery is monitored by the temperature sensor: 1 = vbat, 0 = vbat_rtc downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 124 rev 5 name location rst wk dir description tbyte_busy 28a0[3] 0 0 r indicates that hardware is still writing the 0x28a0 byte. additional wri tes to this byte will be locked out while it is one. write duration could be as long as 6ms. temp_per[2:0] 28a0[2:0] 0 C r/w sets the period between temperature measurements. automatic measurements can be enabled in any mode (msn, brn, lcd, or slp). temp_per = 0 disables automatic temperature updates, in which case temp_start may be used by the mpu to initiate a one - shot temperature measurement. temp_per time (seconds) 0 no temperature updates 1-6 2 (3+ temp_per ) 7 continuous updates temp_pwr 28a0[ 6] 0 C r/w selects the power source for the temp sensor: 1 = v3p3d, 0 = vbat_rtc. this bit is ignored in slp and lcd modes, where the temp sensor is always powered by vbat_rtc. temp_start 28b4[6] 0 0 r/w when temp_per = 0 automatic temperature measurements are disabled, and temp_start may be set by the mpu to initiate a one - shot temperature measurement. temp_start is i gnored in slp and lcd modes. hardware clears temp_start when the temperature measurement is complete. tmux[5 :0] 2502[5 :0] C C r/w selects one of 32 signals for tmuxout. see 2.5.12 for details. tmux2[4:0] 2503[4:0] C C r/w selects one of 32 signals for tmux2out. see 2.5.12 for details. tmuxra[2:0] 270a[2:0] 000 000 r/w the tmux setting for the remote isolated sensor (71m6x01). version[7:0] 2706[7:0] C C r the silicon version index. this word may be read by firmware to determine the sili con version. version[7:0] silicon version 0001 0011 0010 0010 b01 b02 vref_cal 2704[7] 0 0 r/w brings the adc reference voltage out to the vref pin. this feature is disabled when vref_dis =1. vref_dis 2704[6] 0 1 r/w disables the internal adc voltage reference. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 125 name location rst wk dir description vstat[2:0] sfr f9[2:0] C C r this word describes the source of power and the status of the vdd. vstat description 000 system power ok. v3p3a>3.0v. analog modules are functional and accurate. [v3aok,v3ok] = 11 001 system power low. 2.8v2.25v. full digital functionality. [v3aok,v3ok] = 00 , [vddok,vddgt2] = 11 011 bat tery power and vdd>2.0. flash writes are inhibited. if the trimvdd[5] fuse is blown, pll_fast ( i/o ram 0x2200[4] ) is cleared. [v3aok,v3ok] = 00 , [vddok,vddgt2] = 01 101 battery power and vdd<2.0. when vstat=101, processor is nearly out of voltage. processor failure is imminent. [v3aok,v3ok] = 00 , [vddok,vddgt2] = 00 wake_arm 28b2[5] 0 C r/w arms the wake timer and loads it with wake_tmr[7:0] . when sleep or lcd_only is asserted by the mpu, the wake timer become s active. wake_tmr [7:0] 2880[7:0] 0 C r/w timer duration is wake_tmr+1 seconds. wd_rst 28b4[7] 0 0 w reset the wd timer. the wd is reset when a 1 is written to this bit. writing a one clears and restarts the watch dog timer. wf_dio 4 28b1[2] 0 C r dio4 wake flag bit. if dio4 is configured to wake the part, this bit is set whenever the de - bounced version of dio4 rises. it is held in reset if di04 is not configured for wakeup. wf_dio 52 28b1[1] 0 C r dio52 wake flag bit. if dio52 is configured to wake the part, this bit is set whenever t he de - bounced version of dio52 rises. it is held in reset if di052 is not configured for wakeup. wf_dio 55 28b1[0] 0 C r dio55 wake flag bit. if dio55 is configured to wake the part, this bit is set whenever the de - bounced version of dio55 rises. it is held in reset if di055 is not configured for wakeup. wf_tmr 28b1[5] 0 C r indicates that the wake timer caused the part to wake up. wf_pb 28b1[3] 0 C r indicates that the pb caused the part to wake. wf_rx 28b1[4] 0 C r indicates that rx caused the part to wake. wf_cstart wf_rst wf_rstbit wf_ovf wf_erst wf_badvdd 28b0[7] 28b0[6] 28b0[5] 28b0[4] 28b0[3] 28b0[2] 0 1 0 0 0 0 C r indicates that the reset pin, reset bit, erst pin, watchdog timer, the cold start detector, or bad vbat caused the part to reset. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 126 rev 5 5.3 ce interface description 5.3.1 ce program the ce performs the precision computations necessary to accurately measure e ne r gy . these computa tions include offset cancellation, phase compensation, product smoothing, product summation, frequency de tection, var calculation, sag detec tion and voltage phase measurement. all data computed by the ce is dependent on the selected meter equation as given by equ[2:0] ( i/o ram 0x2106[7:5] ). the ce program is supplied by maxim as a data image that can be merged with the mpu operational code for meter applications . typically, the ce program provided with the demonstration code covers most applications and does not need to be modified . other variations of ce code are available from maxim . the descrip tion s provided in this section appl y to the ce code revisions shown in table 77 . c ontact the local maxim representative to obtain the appropriate ce code required for a specific application. table 77 . standard ce codes device local sensors remote sensor 71m6541d/f /g ce41a01 (eq. 0 or 1) ce41b016601 ce41b016201 (eq. 0, 1 or 2) 71m6542f/g ce41a01 (eq. 0 or 1) ce41a04 (eq. 2) 5.3.2 ce data format all ce words are 4 bytes . unless specified otherwise, they are in 32 - bit twos complement format (- 1 = 0xffffffff) . calibration para meters are defined in flash memory (or external eeprom) and must be copied to ce data memory by the mpu before enabling the ce . internal variables are used in internal ce calculations . input variables allow the mpu to control the behavior of the ce code . output variables are outputs of the ce calculations . the corresponding mpu address for the most signi ficant byte is given by 0x0000 + 4 x ce_address and by 0x0003 + 4 x ce_address for the least significant byte. 5.3.3 constants constants used in the ce data memory tables are: ? sampling frequency: f s = 32768 hz/13 = 2520.62 hz. ? f 0 is the fundamental frequency of the mains phases . ? imax is the external rms current corresponding to 250 mv pk (176.8 mv rms) at the inputs ia and ib . imax needs to be adjusted if the pre - amplifier is activated for the iap - ian inputs. for a 250 ? shunt resistor, imax becomes 707 a (176.8 mv rms / 250 ? = 707.2 a rms). ? vmax is the external rms voltage corresponding to 250 mv pk at the va and vb inputs. ? n acc , the accumulation count for energy measurements is sum_samp s [12:0] (i/o ram 0x2107[4:0], 0x2108[7:0]) . ? the duration of the accumulation interval for energy measurements is sum_samp s [12:0] / f s . ? x is a gain constant of the pulse generators. its value is determined by pulse_fast and pulse_slow (see table 83 ). ? voltage lsb (for sag threshold) = vmax * 7.879810 - 9 v. the system constants imax and vmax are used by the mpu to convert internal digital quantities (as used by the ce) to external, i.e., metering quantities. their values are determined by the scaling of the voltage and current sensors used in an actual meter. the lsb values used in this document relate digital quantities at the ce or mpu interface to external meter input quantities. for example, if a sag threshold of 80 v rms is desired at the meter input, the digital value that should be programmed into sag_thr (ce ram 0x24) woul d be 80 v rms * sqrt(2) / sag_thr lsb , where sag_thr lsb is the lsb value in the description of sag_thr (see table 84 ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 127 the parameters equ [2:0] (i/o ram 0x2106[7:5]) , ce_e ( i/o ram 0x2106[0] ), and sum_samp s [12:0] are essential to the function of the ce are stored in i/o ram (see 5.2 i/o ram map C alphabetical order for details ). 5.3.4 environment before starting the ce using the ce_e bit ( i/o ram 0x2106[0]) , the mpu has to establish the proper environ ment for the ce by implementing the following steps: ? locate the ce code in flash memory using ce_lctn[5:0] ( i/o ram 0x2109[5:0] ) ? load the ce data into ram ? establish the equation to be applied in equ [2:0] (i/o ram 0x2106[7:5]) ? establish the number of sample s per accumulation period in sum_samps [12:0] (i/o ram 0x2107[4:0], 0x2108[7:0]) ? establish the number of cycles per adc multiplexer frame ( mux_div[3:0] (i/o ram 0x2100[7:4]) ) ? apply proper values to muxn_sel , as well as proper selections for diffn_e ( i/o ram 0x210c[5:4]) and rmt _e ( i/o ram 0x2709[ 3 ]) in order to configure the analog inputs ? initialize any mpu interrupts, such as ce_busy, xfer_busy, or the po wer failure detection interrupt ? vmax = 600 v, imax = 707 a, and kh = 1 wh/pulse are assumed as default settings when different ce codes are used, a different set of environment parameters need to be established. the exact values for these parameters are listed in the application notes and other documentatio n which accompanies the ce code. opera ting ce codes with environment parameters deviating from the values specified by maxim lead s to unpredictable results. see table 1 and table 2 . typically, there are thirteen 32768 hz cycles per adc multiplexer frame (see 2.2.2 input multiplexer ). t his means that the product of the number of cycles per slot and the number of conversions per frame must be 12 ( plus one settling cycle per frame , see figure 6 and figure 7 ). the default configuration is fir_len [1:0] = 01, i/o ram 0x210c[ 2: 1] , (t hree cycles per conversion) and mux_div [3:0] = 3 (3 conversions per multiplexer cycle). sample configurations can be copied from demo code provided by maxim with the demo kits. 5.3.5 ce calculations referring to table 78 , the mpu selects the desired equation by writing the equ[2:0] ( i/o ram 0x2106[7:5] ). table 78 : ce equ equations and element input mapping equ watt & var formula (wsum/varsum) inputs used for energy /current calculation w0sum/ var0sum w1sum/ var1sum i0sq sum i1sq sum 0 va ia C 1 element, 2w 1 f va*ia va*ib ia C 1 va*(ia - ib)/2 C 1 element, 3w 1 f va*(ia - ib)/2 C ia - ib ib 2 ? va*ia + vb*ib C 2 element, 3w 3 f delta va*ia vb*ib ia ib note: ? 71m6542f/g only. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 128 rev 5 5.3.6 ce front end data (raw data) access to the raw data provided by the afe is possible by reading addresses 0 - 3, 9 and 10 (decimal) shown in table 79 . the mux_sel column in table 79 shows the mux_sel handles for the various sensor input pins. for ex ample, if differential mode is enable via control bit diffa _e = 1 ( i/o ram 0x210c[4] ) , then the inputs iap and ian are combined together to form a single differential input and the corresponding mux_sel han dle is 0. similarly, the ce ram location column provides the ce ram address where the sample data is stored. continuing with the same example, if diffa _e = 1, the corresponding ce ram location where the samples for t he iap - ian diffe rential input are stored is 0 and ce ram location is not disturbed. the ib input can be configured as a direct - connected sensor (i.e., directly connected to the 71m654x) or as a remote sensor (i.e., using a 71m6x01 isolated sensor). if the remote sensor is disabled by rmt_e = 0 and differential mode is enabled by diffb _e = 1 (i/o ram 0x210c[5] ) , then ib p and ib n form a differential input with a mux_sel handle of 2, and the corresponding samples are stored in ce ram location 2 (ce ram location 3 is not disturbed) . if the remote sensor enable bit rmt_e = 1 and diffb _e = 0 or 1, then the mux_sel handle is undefined (i.e., the sensor is not connected to the 71m654x, so mux_sel does not apply , see 2.2 analog front end (afe) on page 12 ) , and the samples corresponding to this remote differential ibp - ibn input are stored in ce ram location 2 (ce ram location 3 is not disturbed) . the voltage sensor inputs ( va and vb ) do not have any associated configuration bits. va has a mux_sel handle value of 10, and its samples are stored in ce ram location 10. vb has a mux_sel handle value of 9 and its samples are stored in ce ram location 9. table 79 : ce raw data access locations adc lo cation pin mux_sel handle ce ram location diffa _e diffa _e 0 1 0 1 adc0 iap 0 0 0 0 adc1 iap 1 1 rmt_e, diffb _e rmt_e, diffb _e 0,0 0,1 1,0 1,1 0,0 0,1 1,0 1,1 adc2 i bp 2 2 C C 2 2 2* 2* adc3 i bn 3 3 there are no configuration bits for adc9, 10 adc 9 vb? 9 9 adc10 va 10 10 notes: * remote interface data . ? 71m6542f/g only. 5.3.7 f ce s tatus and control the ce status word, cestatus , is useful for generating early warnings to the mpu ( table 80 ) . it contains sag warn ings for phase a and b, as well as f0 , the derived clock operating at the fundamental input fre - quency. the mpu can read the ce status word at every ce_busy interrupt. since the ce_busy inter - rupt occurs at 2520.6 hz, it is desirable to minimize the computation required in the interrupt handler of the mpu . table 80 : cestatus register ce address name description 0x80 cestatus see description of cestatus bits in table 81 . cestatus provides information about the status of voltage and input ac signal frequency, which are us eful for generating an early power fail warning to initiate necessary data storage. cestatus re pre sents the downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 129 status flags for the preceding ce code pass (ce_busy interrupt). the significance of the bits in cestatus is shown in table 81 . table 81 : cestatus ( ce ram 0x80 ) bit definitions cestatus bit name description 31: 4 not used these unused bits are always zero. 3 f0 f0 is a square wave at the exact fundamental input frequency. 2 not used this unused bit is always zero. 1 sag_b normally zero. becomes one when vb remains below sag_thr for sag_cnt samples. does not return to zero until vb rises above sag_thr . 0 sag_a normally zero. becomes one when va remains below sag_thr for sag_cnt samples. does not return to zero until va rises above sag_thr . the ce is initialized by the mpu using ceconfig ( table 82 ). t his register contains in packed form sag_cnt, freqsel [1:0] , ext_pulse, pulse_slow and pulse_fast . the ceconfig bit definitions are given in table 83 . table 82 : ceconfig register ce address name data description 0x20 ceconfig 0x 0 030db00 1 0x00b0db00 2 see description of the ce config bits in table 83 . 1. default for ce41a01 (71m6541d/f /g or ce41a04 ( 71m6542f/g ) ce code for use with local sensors. 2. default for ce41b016201 and ce41b016601 codes that support the 71m6x01 remote sensors. table 83 : ce config ( ce ram 0x20 ) bit definitions ceconfig bit name default description 23 reserved 0 reserved (can be used by the mpu to indicate that the 71m6x01 is being used; ce does not use this). 22 ext_temp 0 when 1, the mpu controls temperature compensation via the gain_adjn registers ( ce ram 0x40 - 0x42) , when 0, the ce is in control. 21 edge_int 1 when 1, xpulse produces a pulse for each zero - crossing of the mains phase selected by freqsel[1:0] , which can be used to interrupt the mpu. 20 sag_int 1 when 1, activates ypulse output when a sag condition is de tected. 19 :8 sag_cnt 252 (0xfc ) the number of consecutive voltage samples below sag_thr (ce ram 0x24 ) before a sag alarm is d eclared. the default value is equivalent to 100 ms . 7:6 freqsel[1:0] 0 freqsel [1 :0] selects the phase to be used for the frequency monitor, sag detection, and for the zero crossing counter ( mainedge_x , ce ram 0x83 ). fr e q sel [1:0] phase se lected 0 0 a 0 1 b* 1 x not allowed * 71m6542f/g only downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 130 rev 5 5 ext_pulse 1 when zero, causes the pulse generat ors to respond to internal data (wpulse = wsum_x (ce ram 0x84) , vpulse = varsum_x (ce ram 0x88) ) . otherwise, the generators respond to values the mpu places in apulsew and apulser (ce ram 0x4 5 and 0x4 9) . 4 :2 reserved 0 reserved. 1 pulse_fast 0 when pulse_fast = 1, the pulse generator input is increased 16x. when pulse_slow = 1, the pulse generator input is re duced by a factor of 64. these two parameters control the pulse gain factor x (see table below). allowed values are either 1 or 0. default is 0 for both (x = 6). pulse_ fast pulse_ slow x 0 0 1.5 * 2 2 = 6 1 0 1.5 * 2 6 = 96 0 1 1.5 * 2 -4 = 0.09375 1 1 do not use 0 pulse_slow 0 the freqsel[1:0] field in ceconfig ( ce ram 0x20[7:6] ) selects the ph ase that is utilized to generate a sag interrupt . thus, a sag_int event occurs when the selected phase has satisfied the sag event criteria as set by the sag_thr ( ce ram 0x24 ) register and the sag_cnt field in ceconfig (ce ram 0x20[19:8]) . w hen the sag_int bit ( ce ram 0x20[20] ) is set to 1, a sag event generate s a transition on the ypulse output. in a two - phase system ( 71m6542f/g ), and after a sag interrupt, the mpu should change the freqsel[1:0] setting to select the other phase, if it is powered. even though a sag interrupt is only gen erated on the selected phase, both phases are simultaneously checked for sag. the presence of power on a given phase can be sensed by directly checking the sag_a and sag_b bits in cestatus ( ce ram 0x80 [0:1] ). the ext_temp bit enables temperature compensation by the mpu, when set to 1. when 0, internal (ce) temperature compensation is enabled. the ce pulse generator can be controlled by either the mpu (external) or c e (internal) variables. control is by the mpu if the ext _ pulse bit = 1 ( ce ram 0x20[5] ) . in this case, the mpu controls the pulse rate (external pulse generation) by placing values into apulsew and apulser (ce ram 0x4 5 and 0x4 9) . by setting ext _ pulse = 0, the ce controls the pulse rate based on wsum _x (ce ram 0x84) and varsum _x (ce ram 0x8 8) . the 71m6541d/f /g and 71m6542f/g demo code creep function halts both internal and external pulse generation. table 84 : sag threshold and gain adjust control ce address name default description 0x24 sag_thr 2.39*10 7 the voltage threshold for sag warnings. the default value is equivalent to 113vpk or 80 vrms if vmax = 600 v rms . ??? _ ??? = ???? ? 2 ???? ? 7. 8798 ? 10 ?9 0x40 gain_adj 0 16384 t his register scales the voltage measurement channels va and vb * . the default value of 16384 is equivalent to unity gain (1.000). * 71m6542f/g only 0x41 gain_adj 1 16384 this register scales the ia current channel for phase a . the default value of 16384 is equivalent to unity gain (1.000). 0x42 gain_adj2 16384 this register scales the ib current channel for phase b. the de fault value of 16384 is equivalent to unity gain (1.000). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 131 5.3.8 ce transfer v ariables when the mpu receives the xfer_busy interrupt, it knows that fresh data is availab le in the transfer variables . ce trans fer variables are modified during the ce code pass that ends with an xfer_busy interrupt. they remain constant throughout each accumulation interval. in this data sheet, the names of ce transfer variables always end with _x . the transfer variables can be categorized as: ? fundamental energy measurement variables ? instantaneous (rms) values ? other measurement parameters 5.3.8.1 fundamental energy measurement variables table 85 and table 86 describe each transfer variable for fundamental energy measurement . all variables are signed 32 - bit integers . accumulated variables such as wsum are internally scaled so they have at least 2x margin before overflow when the integration time is one second . additionally, the hardware does not permit output values to fold back upon overflow . table 85 : ce transfer variables (with local sensors ) ce address name description configuration 0x84 ? wsum_x the signed sum: w0sum_x+w1sum_x . not used for equ [2:0] = 0 ( i/o ram 0x2106[7:5] ) and equ [2:0] = 1. figure 35 (page 93 ) fig ure 37 (page 95 ) 0x85 w0sum_x the sum of wh samples from each wattmeter element . lsb = 9.4045 *10 - 13 * vmax * imax wh . for ce41a04 : lsb = 6.6952*10 - 13 * vmax * imax wh. 0x86 w1sum_x 0x88 ? varsum_x the signed sum: var0sum_x+var1sum_x. not used for equ[2:0] = 0 and equ [2:0] = 1. 0x89 var0sum_x the sum of var h samples from each wattmeter element . lsb = 9.4045 *10 - 13 * vmax * imax varh . for ce41a04, lsb = 6.6952*10 - 13 * vmax * imax varh. 0x8a var1sum_x note: ? 71m6542 only. table 86 : ce transfer variables (with remote sensor ) ce address name description configuration 0x84 ? wsum_x the signed sum: w0sum_x+w1sum_x . not used for equ [2:0] = 0 ( i/o ram 0x2106[7:5] ) and equ [2:0] = 1. figure 36 (page 94 ) figure 38 (page 96 ) 0x85 w0sum_x the sum of wh samples from each wattmeter element . lsb = 1.5512 4 *10 -12 * vmax * imax wh. 0x86 w1sum_x 0x88 ? varsum_x the signed sum: var0sum_x+var1sum_x. not used for equ[2:0] = 0 and equ [2:0] = 1. 0x89 var0sum_x the sum of var h samples from each wattmeter element . lsb = 1.55124*10 -12 * vmax * imax varh. 0x8a var1sum_x note: ? 71m6542 only. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 132 rev 5 w sum_x ( ce ram 0x84 ) and varsum_x (ce ram 0x88) are the signed sum of phase - a and phase - b wh or varh values according to the metering equation specified in the i/o ram control field equ [2:0] (i/o ram 0x2106[7:5]) . wxsum_x (x = 0 or 1 , ce ram 0x85 and 0x86 ) is the wh value accumulated for phase x in the last accumulation int erval and can be computed based on the specified lsb value. 5.3.8.2 instantaneous energy measurement variables ixsqsum_x and vxsqsum (see table 87 ) are the sum of the squared current and voltage samples acquired during the last accumulation interval. table 87 : ce energy measurement variables (with local sensors) ce address name description configuration 0x8c i0sqsum_x the sum of squared current samples from each element. lsb = 9.4045 *10 - 13 imax 2 a 2 h for ce41a04, lsb = 6.6952*10 - 13 imax 2 a 2 h. when equ = 1, i0sqsum_x is based on ia and ib. figure 35 (page 93 ) fig ure 37 (page 95 ) 0x8d i1sqsum_x 0x90 v0sqsum_x the sum of squared voltage samples from each element. lsb = 9.4045 *10 - 13 vmax 2 v 2 h for ce41a04, lsb = 6.6952*10^ - 13 vmax 2 v 2 h. 0x91 ? v1sqsum_x ? 71m6542 only. table 88 : ce energy measurement variables (with remote sensor) ce address name description configuration 0x8c i0sqsum_x the sum of squared current samples from each element. lsb i = 2.55872*10 -12 * imax 2 a 2 h when equ = 1, i0sqsum_x is based on ia and ib. figure 36 (page 94 ) figure 38 (page 96 ) 0x8d i1sqsum_x 0x90 v0sqsum_x the sum of squared voltage samples from each element. lsb v = 9.40448*10 - 13 * vmax 2 v 2 h 0x91 ? v1sqsum_x ? 71m6542 only. the rms values can be computed by the mpu from the squared current and voltage samples as follows: note: n acc = sum_samps[12:0] ( ce ram 0x 23 ). other transfer variables include those available for frequency and phase measurement, and those re flecting the count of the zero - crossings of the mains voltage and the battery voltage. these transfer variables are listed in table 89 . mainedge_x ( ce ram 0x83 ) reflects the number of half - cycles accounted for in the last accumulated interval for the ac signal of the phase specified in the freqsel [1:0] field in ceconfig ( ce ram 0x20[7:6] ). mainedge_x is useful for implementing a real - time clock based on the input ac signal. acc s i rms n f lsb ixsqsum ix ? ? ? = 3600 acc s v rms n f lsb vxsqsum vx ? ? ? = 3600 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 133 table 89 : other transfer variables ce address name description 0x82 freq_x fundamental frequency : lsb 6 32 10 509 .0 2 6. 2520 ? ? hz hz (for local ) lsb 6 32 10 587 .0 2 6. 2520 ? ? hz hz (for remote ) 0x83 mainedge_x the number of edge crossings of the selected voltage in the pre vious ac cumulation interval. edge crossings are either direction and are de - bounced. 5.3.9 pulse generation table 90 describes the ce pulse generation parameters . the combination of the ceconfig pulse_slow and pulse_fast bits ( ce ram 0x20[0:1]) control s the speed of the pulse rate. the default values of 0 and 0 maintain the original pulse rate given by the kh equation. wrate ( ce ram 0x21 ) controls the number of pulses that are generated per measured wh and varh quantities. the lower wrate is , the slower the pulse rate for the measured energy quantity. the metering constant kh is de rived from wrate as the amount of energy measured for each pulse. that is, if kh = 1wh/pulse, a power applied to the meter of 120 v and 30 a results in one pulse per second. if the load is 240 v at 150 a, ten pulses per second are generated. control is transferred to the mpu for pulse generation if ext_pulse = 1 ( ce ram 0x20[5] ). in this case, the pulse rate is de termined by apulsew and apulser (ce ram 0x4 5 and 0x4 9) . the mpu has to load the source for pulse generation in apulsew and apulser to generate pulses. irrespective of the ext_pulse status , the output pulse rate controlled by apulsew and apulser is implemented by the ce only. by setting ext_pulse = 1 , the mpu is providing the source for pulse generation. if ext_ pulse is 0 , w0sum_x (ce ram 0x8 5) and var0sum_x (ce ram 0x8 9) are the default pulse generation sources. in this case, creep cannot be controlled since it is an mpu function. the maximum pulse rate is 3*f s = 7.5 6 khz . see 2.3.6.2 vpulse and wpulse for details on how to adjust the timing of the ou t put pulses. the maximum time jitter is 1/6 of the multiplexer cycle period (nominally 67 s) and is independent of the number of pulses measured. thus, if the pulse generator is monitored for one second, the peak jitter is 67 ppm. after 10 seconds, the peak jitter is 6.7 ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster than its maximum rate, it simply output s at its maximum rate without exhibiting any rollover characteristics. the actual pulse rate, using wsum as an example, is: hz x f wsum wrate rate s 46 2 ? ? ? = , where f s = sampling frequency (2520.6 hz), x = pulse speed factor derived from the ce variables pulse_slow (ce ram 0x20[0]) and pulse_fast ( ce ram 0x20[1] ). downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 134 rev 5 table 90 : ce pulse generation parameters ce address name default description 0x21 wrate 54 7 pulse wh x n wrate k imax vmax kh acc / ? ? ? ? ? = where: k = 66.1782 (local sensors) k = 109.1587 (remote sensor) k = 47.1132 (ce41a04 and local sensors) n acc = sum_samps[12:0] (ce ram 0x23) see table 83 for the definition of x. the default value yields 1.0 wh/pulse for vmax = 600 v and imax = 208 a . the maximum value for wrate is 32,768 (2 15 ). 0x22 kvar 644 4 scale factor for var measurement. 0x23 sum_ samps 2520 sum_samp s (n acc ). 0x4 5 apulsew 0 wh pulse (wpulse) generator input to be updated by the mpu when using external pulse generation . the output pulse rate is: apulsew * f s * 2 - 32 * wrate * x * 2 - 14 . thi s input is buffered and can be updated by the mpu during a conversion interval. the change take s effect at the beginning of the next interval. 0x4 6 wpulse_ctr 0 wpulse counter. 0x4 7 wpulse_frac 0 unsigned numerator, containing a fraction of a pulse. the value in this register always count s up towards the next pulse. 0x4 8 wsum_accum 0 roll - over accumulator for wpulse. 0x4 9 a pulser 0 var h ( vpulse ) pulse generator input . 0x4 a vpulse _ctr 0 vpulse counter. 0x4 b vpulse_frac 0 unsigned numerator, containing a fraction of a pulse. the value in this register always count s up towards the next pulse. 0x4 c vsum_accum 0 roll - over accumulator for vpulse . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 135 5.3.10 other ce parameters table 91 shows the ce parameters used for suppression of noise due to scaling and truncation effects. table 91 : ce parameters for noise suppression and code version ce address name default description 0x25 quant _va 0 compensation factors for truncation and noise in voltage, current , real energy and reactive energy for phase a . 0x2 6 quant _ ia 0 0x27 quant _a 0 0x2 8 quant_vara 0 0x29 ? quant _vb 0 compensation factors for truncation and noise in voltage, current, real energy and reactive energy for phase b. ? 71m6542 only. 0x2 a quant _ib 0 0x2b quant_b 0 0x2c quant_varb 0 0x38 0x43453431 ce file name identifier in ascii format ( ce41a01f ). these values are overwritten as soon as the ce starts 0x39 0x6130316b 0x3a 0x00000000 lsb weights for use with local sensors: ) ( 10 08656 .5 _ _ 2 2 13 amps imax lsb ix quant ? ? = ? for ce41a04, quant_ix_lsb = 3.621210 - 13 imax 2 (amps 2 ) ) ( 10 04173 .1 _ _ 9 watts imax vmax lsb wx quant ? ? ? = ? for ce41a04, quant_wx_lsb = 7.416210 - 10 vmax imax (watts) ) ( 10 04173 .1 _ _ 9 vars imax vmax lsb varx quant ? ? ? = ? for ce41a04, quant_varx_lsb = 7.4162 10 - 10 vmax imax (vars) lsb weights for use with the 71m6x01 isolated sensors: ) ( 10 38392 .1 _ _ 2 2 12 amps imax lsb ix quant ? ? = ? ) ( 10 71829 .1 _ _ 9 watts imax vmax lsb wx quant ? ? ? = ? ) ( 10 71829 .1 _ _ 9 vars imax vmax lsb varx quant ? ? ? = ? downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 136 rev 5 5.3.11 ce calibration parameters table 92 lists the parameters that are typically entered to effect calibration of meter accuracy . table 92 : ce calibration parameters ce address name default description 0x10 cal_ia 16384 these constants control the gain of their respective channels. the n ominal value for each parameter is 2 14 = 16384. the gain of each channel is directly proportional to its cal parameter. thus, if the gain of a channel is 1% slow, cal should be increased by 1%. refer to the 71m6541 demo board users manual for the equations to calculate these calibration parameters. ? 71m6542 only. 0x11 cal_va 16384 0x13 cal_ib 16384 0x14 ? cal_vb 16384 0x12 phadj_a 0 t hese constants control the ct phase compensation. c om pensation does not occur when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. the range is 215 C 1. if it is desired to delay the current by the angle , the equations are: ? ? ? = tan tan x phadj 0131 .0 1487 .0 02229 .0 2 _ 20 at 60hz ? ? ? = tan tan x phadj 009695 .0 1241 .0 0155 .0 2 _ 20 at 50hz 0x15 phadj_b 0 0x12 dlyadj_a 0 the shunt delay compensation is obtained using the equation provided below: ( ) ? ?? ? ? ?? ? + ? ?? ? ? ?? ? + ? ?? ? ? ?? ? d + d= s s s rees rees f f c b f f ab f f a x dlyadj 2 sin 2 cos 2 2 cos 360 2 2 1.0 1 _ 2 2 14 deg deg where: a a 2 = ? 1 2 + = a b ? ? = 2 ? 2 + 4 ???? ? 2 ?? ? ? ? + 2 where, f is the mains frequency and f s is the sampling frequency. the table below provides the value of a for each current channel: channel value of a (decimal) eq. 0 or 2 eq. 1 dlyadj_a 15811 / 2 14 6811 / 2 14 dlyadj_ b - 1384 / 2 14 - 1384 / 2 14 0x15 dlyadj_b 0 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 137 5.3.12 ce flow diagrams figure 44 through figure 46 show the data flow through the ce in simplified form. functions not shown include delay compensation, sag detection, scaling and the processing of meter equations. figure 44 : ce data flow: multiplexer and adc figure 45 : ce data flow: scaling, gain control, intermediate variables downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 138 rev 5 figure 46 : ce data flow: squaring and summation stages i0 w0 square w1 var0 var1 v0 i1 i0sq v0sq i1sq sum i0sqsum_x v0sqsum_x i1sqsum_x sum w0sum_x w1sum_x var0sum_x var1sum_x sum_samps =2520 mpu f0 i 2 i 2 v 2 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 139 6 electrical s pecifications this section provides the electrical specifications for the 71m654x. please refer to the 71m6xxx data sheet for the 71m6x01 electrical specifications, pin - out , and package mechanical data. the device s are 100% production tested at room temperature, and performance over the full temperature range is guaranteed by design. 6.1 a bsolute m aximum r atings table 93 shows the absolute maximum ratings for the device. stresses beyond absolute maximum ratings may cause permanent damage to the device. these are stress ratings only and functional operation at these or any other conditions beyond those indicated under recommended operating conditions ( see 6.3 r ecommended operating c onditions ) is not implied. exposure to absolute - maximum - rated conditions for extended periods may affect de vice reliability. all voltages are with respect to gnda. table 93 : absolute maximum ratings voltage and current supplies and ground pins v3p3sys, v3p3a ? 0.5 v to 4.6 v vbat , vbat_rtc - 0.5 v to 4.6 v gndd - 0.1 v to +0.1 v analog output pins vref - 10 ma to +10 ma, - 0.5 v to v3p3a+0.5 v vdd - 10 ma t o 10 ma, - 0.5 to 3.0 v v3p3d - 10 ma to 10 ma, - 0.5 v to 4.6 v vlcd - 10 ma t o 10 ma, - 0.5 v to 6 v analog input pins iap - ian , va , ibp - ibn , vb ? ( ? 71m6542f/g only) - 10 ma to +10 ma - 0.5 v to v3p3a+0.5 v xin, xout - 10 ma to +10 ma - 0.5 v to 3.0 v seg and segdio pins configured as seg or com drivers -1 ma to 1 ma, - 0.5 v to vlcd+0.5 v configured as digital inputs - 10 ma to 10 ma, - 0.5 v to 6 v configured as digital outputs - 10 ma to 10 ma, - 0.5 v to v3p3d+0.5 v digital pins inputs (pb, reset, rx, ice_e, test) - 10 ma to 10 ma, - 0.5 to 6 v outputs (tx) - 10 ma to 10 ma, - 0.5 v to v3p3d+0.5 v downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 140 rev 5 temperature and esd stress operating junction temperature (peak, 100ms) 140 c operating junction temperature (continuous) 125 c storage temperature ? 45 c to +165 c solder temperature C 10 second duration + 250 c esd stress on all pins 4 kv 6.2 recommended external components table 94 : recommended external components name from to function value unit c1 v3p3a gnda bypass capacitor for 3.3 v supply 0.1 20% f c2 v3p3d gndd bypass capacitor for 3.3 v output 0.1 20% f csys v3p3sys gndd bypass capacitor for v3p3sys 1.0 30% f cvdd vdd gndd bypass capacitor for v dd 0.1 20% f cv lc d vlc d gndd bypass capacitor for v lc d pin (when charge pump is used) 0.1 20% f xtal xin xout 32.768 khz crystal C electrically similar to ecs .327 - 12.5 - 17x, vishay xt26t or suntsu scp6 C 32.768khz tr ( load capacitance 12.5 pf ). 32.768 khz cxs xin gnda load capacitor values for crystal depend on crystal specifications and board parasitics. nominal values are based on 4 pf board capacitance and include an allowance for chip capacitance. 15 10% pf cxl xout gnda 10 10% pf 6.3 r ecommended operating c onditions unless otherwise specified, all parameters listed in 6.4 p erformance s pecifications and 6.5 t iming s pecifications are valid over the recommended operating conditions provided in table 95 below. table 95 : recommended operating conditions p arameter condition min typ max unit v3p3sys and v3p3a supply voltage for precision metering operation (msn mode) . voltages at vbat and vbat_rtc need not be present. vbat=0 v to 3.8 v vbat_rtc =0 v to 3.8 v 3.0 3.6 v vbat voltage (brn mode). v3p3sys is below the 2.8 v comparator threshold. either v3p3sys or vbat_rtc must be high enough to power the rtc module. v3p3sys < 2.8 v and max (vbat_rtc, v3p3sys) > 2.0 v 2.5 3.8 v vbat_rtc voltage. vbat_rtc is not needed to support the rtc and non - volatile memory unless v3p3sys < 2.0 v v3p3sys<2.0 v 2.0 3.8 v operating temperature - 40 +85 oc notes: 1. gnda and gndd must be connected together. 2. v3p3sys and v3p3a m u st be connected together. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 141 6.4 p erformance s pecifications 6.4.1 input logic levels table 96 : i nput logic levels p arameter c ondition m in t yp m ax u nit digital high - level input voltage 1 , v ih 2 v digital low - level input voltage 1 , v il 0.8 v input pullup current, i il e_rxtx, e_ rst , e_tclk opt_rx, opt_tx spi_csz (segdio36) other digital inputs vin=0 v , ice_e= 3.3 v 10 10 10 -1 0 100 100 10 1 a a ? a input pull down current, i ih ice_e, reset, test other digital inputs vin=v3p3d 10 -1 0 100 1 a a note: 1. in battery powered modes, di gital inputs should be below 0.1 v or above v bat C 0.1 v to minimize battery current. 6.4.2 o utput logic levels table 97 : output logic levels p arameter c ondition m in t yp m ax u nit digital high - level output voltage v oh i load = 1 ma v3p3d C 0.4 v i load = 15 ma (see notes 1 , 2) v3p3d - 0.6 v digital low - level output voltage v ol i load = 1 ma 0 0.4 v i load = 15 ma (see note 1) 0 0.8 v note : 1. guaranteed by design, not production tested. 2. caution: the sum of all pull up currents must be compatible with the on - resistance of the internal v3p3d switch. see 6.4.6 v3p3d s witch on page 144 . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 142 rev 5 6.4.3 battery monitor table 98 : batter y monitor performance specifications ( temp_bat = 1) parameter condition min typ max unit bv: battery voltage (definition) msn mode, temp_pwr = 1 brn mode, temp_pwr = temp_bsel ?? = 3.3 ? + ( ?????? ? 142 ) ? 0. 0246 ? + ????? ? 297 ?? ?? = 3. 291 ? + ( ?????? ? 142 ) ? 0. 0255 ? + ????? ? 328 ?? v measurement error ?? ? ?? ? ? ? 1 100 vbat bv vbat = 2.0 v 2.5 v 3.0 v 4.0 v - 7.5 -5 -3 -3 7.5 5 3 5 % input impedance in continuous measurement, msn mode. v(vbat_rtc)/i(vbat_rtc) v3p3 = 3.3 v, temp_bsel = 0, temp_per = 111, vbat_rtc = 3.6 v, 1 m ? load applied with bcurr ibat( bcurr =1) - ibat( bcurr =0) v3p3 = 3.3 v 50 100 140 a 6.4.4 temperature monitor table 99 . temperature monitor parameter condition min typ max unit temperature measurement equation in msn, temp_pwr =1: temp = 0. 325 ? stemp + 22 in brn, temp_pwr = temp_bsel : ???? = 0. 325 ? ????? + 0. 00218 ? ?????? 2 ? 0. 609 ? ?????? + 64 .4 c temperature error t a = +22 c -2 +2 c vbat_rtc charge per measurement temp_ bsel = 0, temp_p wr =0, slp mode, vbat_rtc = 3.6 v 16 c duration of temperature measurement after setting temp_start (see note 1) temp_pwr = 0, temp_per = 7, slp mode, vbat_rtc = 3.6 v force v3p3d = 1.0 v 15 60 ms note s: 1. guaranteed by design; not production tested. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 143 6.4.5 s upply c urrent the supply currents provided in table 100 below include only the current consumed by the 71m654x. refer to the 71m6xxx data sheet for additional current required when using a 71m6x01 remote sensor. table 100 : supply current performance specifications parameter condition min typ max unit i1: v3p3a + v3p3sys current, half - speed ( adc_div =1) (see note 1) single - phase: 2 currents, 1 voltage v3p3a = v3p3sys = 3.3 v, mpu_div [2:0] = 3 (614 khz mpu clock ), no flash memory write, rtm_e =0, pre_e =0, ce_e =1, adc_e =1, adc_div =1, mux_div[3:0] =3, fir_len[1:0] =1, pll_fast =1 5. 5 6. 7 ma i1a: v3p3a + v3p3sys current, half - speed ( adc_div =1) (see note 1) same as i1, except pll_fast =0 2. 6 3. 5 ma i1b: v3p3a + v3p3sys current, half - speed ( adc_div =1) (see note 1) same as i1, except pre_e = 1 5.7 6.9 ma i1c : v3p3a + v3p3sys current, half - speed ( adc_div =1) (see note 1) same as i1, except pll_fast = 0 and pre_e = 1 2.6 3.6 ma i2: v3p3a + v3p3sys dynamic current same as i1, except with varia tion of mpu_div [2:0] . 4.3 i- i 3 mpu_div 0 mpu_div = = 0.4 0.6 ma/ mhz vbat current i3: msn mode i4: brn mode i5: lcd mode ( ext. vlcd ) i6: lcd mode ( boost, dac ) note 1 i7: lcd mode ( dac ) note 1 i8: lcd mode (vbat) note 1 i9: slp mode ce_e =0 lcd_vmode[1:0] =3 , also see note 2 lcd_vmode[1:0] =2, also see note 3 lcd_vmode[1:0] =1, also see note 3 lcd_vmode[1:0] =0, also see note 3 slp mode - 300 - 300 0 2 .4 0.4 24 3. 0 1. 1 0 300 3.2 108 36 11 3.4 +300 na ma na a a a na vbat_rtc current i 10 : msn i 11 : brn i 12 : lcd mode i 13 : slp mode i 14 : slp mode (see note 1) lcd_vmode[1:0] =2, als o see note 2 t a 25 c t a = 85 c - 300 0 240 1.8 0.7 1.5 300 32 0 4.1 1. 7 3.2 na na a a a i15: v3p3a + v3p3sys current, write flash with ice same as i1, except write flash at maximum rate, ce_e =0, adc_e =0. 7.1 8.7 ma notes: 1. guaranteed by design; not production tested. 2. lcd_dac[4:0] =5 (2.9v), lcd_clk[1:0] =2, lcd_mode[2:0] =6, all lcd_mapn bits = 1, lcd_blank =0, lcd_on =1. 3. lcd_dac[4:0] =5 (2.9v), lcd_clk[1:0] =2, lcd_mode[2:0] =6, all lcd_mapn bits = 0. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 144 rev 5 6.4.6 v3p3d s witch table 101 : v3p3d switch performance specifications p arameter c ondition m in t yp max unit on resistance C v3p3sys to v3p3d | i v3p3d | 1 ma 10 on resistance C vbat to v3p3d | i v3p3d | 1 ma, vbat>2.5v 10 v3p3d i oh , msn v3p3sys = 3v v3p3d = 2.9v 10 ma v3p3d i oh , brn vbat = 2.6v v3p3d = 2.5v 10 ma 6.4.7 internal power fault comparators table 102 . internal power fault comparator specifications p arameter condition m in t yp max unit overall response time 100mv overdrive, falling 100mv overdrive, rising 20 200 200 s s falling threshold 3.0 v comparator 2.8 v comparator difference 3.0v and 2.8v comparators v3p3 falling 2.83 2.75 50 2.93 2.81 136 3.03 2.87 220 v v mv falling threshold 2.25 v comparator 2.0 v comparator vdd (@vbat=3.0v) C 2.25v comparator difference 2.25v and 2.0v comparators vdd falling 2.2 1.9 0 0.25 0.15 2.25 2.00 0.35 0.25 2.5 2.20 0.45 0.35 v v v v hysteresis, (r ising threshold - f alling threshold ) 3.0 v comparator 2.8 v comparator 2.25 v comparator 2.0 v comparator t a = 22 c 22 25 10 10 45 42 33 28 65 60 60 60 mv mv mv mv 6.4.8 2.5 v v oltage r egulator C system power table 103 : 2.5 v voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 v3p3 = 3.0 v - 3.8 v i load = 0 ma 2.55 2. 65 2.7 5 v v2p5 load regulation v bat = 3.3 v , v3p3 = 0 v i load = 0 ma to 1 ma 40 mv voltage overhead v3p3 sys - v2p5 i load = 5 ma, reduce v3p3d until v2p5 drops 200 mv 440 mv downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 145 6.4.9 2.5 v v oltage r egulator C battery power unless otherwise specified, v3p3sys = v3p3a = 0, pb=gnd ( brn ). table 104 : low - power voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 vbat = 3.0 v - 3.8 v, v3p3 = 0 v, i load = 0 ma 2.55 2. 65 2.7 5 v v2p5 load regulation vbat = 3.3 v, v3p3 = 0 v, i load = 0 ma to 1 ma 40 mv voltage overhead 2v ? vbat - vdd i load = 0 ma, vbat = 2.0 v, v3p3 = 0 v. 20 0 mv 6.4.10 c rystal o scillator measurement conditions: crystal disconnected, test load of 200 pf/100 k between xout and gndd. table 105 : crystal oscillator performance specifications p arameter c ondition m in t yp max unit maximum output power to crystal crystal connected, see note 1 1 w xin to xout capacitance (see note 1) 3 pf capacitance change on xout rtc a _adj = 7f to 0, bias voltage = unbiased vpp = 0.1 v 15 pf note s: 1. guaranteed by design; not production tested. 6.4.11 phase - locked loop (pll) table 106 : pll performance specifications parameter c ondition m in t yp max unit pll power up settling time (see note 1) pll_fast = 0, v3p3 = 0 v to 3.3 v step , measured from first edge of mck 5 ms pll_fast settling time pll_fast rise (see note 1) pll_fast fall (see note 1) v3p3 = 0 v, vbat = 3.8 v to 2.0 v 5 5 ms ms pll slp to msn settling time (see note 2) pll_fast = 0 5 ms pll power up overshoot (see note 1) pll_fast = 0 2.5 mhz notes: 1. guaranteed by design; not production tested. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 146 rev 5 6.4.12 lcd drivers table 107 : lcd driver performance specifications p arameter c ondition m in t yp max unit vlcd current (see notes 1 to 4) vlcd=3.3, all lcd map bits=0 vlcd=5.0, all lcd map bits=0 2 3 ua ua notes: 1. these specifications apply to all com and seg pins. 2. vlcd = 2.5 v to 5 v. 3. lcd_vmode =3, lcd_on =1, lcd_blank =0, lcd_mode =6, lcd_clk =2. 4. output load is 74 pf per seg and com pin. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 147 6.4.13 v lcd generator table 108 : lcd driver performance specifications 1 parameter condition min typ max unit vsys to vlcd switch impedance v3p3 = 3.3 v, rvlcd=removed, lcd_bat =0, lcd_vmode[1:0] =0, ?ilcd=10 a 750 ? vbat to vlcd switch impedance v3p3 = 0 v, vbat = 2.5 v, rvlcd =removed, lcd_bat =1, lcd_vmode[1:0] =0, ?ilcd=10 a 700 ? lcd boost frequenc y lcd_vmode[1:0] = 2, rvlcd = removed, cvlcd = removed pll_fast =1 pll_fast =0 820 786 khz khz vlcd ioh current (vlcd(0)- vlcd(ioh)<0.25) lcd_vmode[1:0] = 2, lcd_clk[1:0] = 2, rvlcd = removed, v3p3 = 3.3v, lcd_dac[4:0] = 1f 10 a from lcdadj0 and lcdadj12 fuses: ?????? ( ??? _ ??? ) = 5 ?? ? ?????? 0 + ?????? 12 ? ?????? 0 12 ??? _ ??? ? ???? ??? ( ??? _ ??? ) = 2. 65 + 2. 65 ??? _ ??? 31 + ?????? ( ??? _ ??? ) the above equations describe the nominal value of vlcd for a specific lcd_dac value. the specifications below list the maximum deviation between actual vlcd and vlcdnom . note that when vcc and boost are insufficient, the lcd dac will not reach its target value and a large negativ e error will occur. lcd_dac error. vlcd - vlcdnom (see note 2) full scale, with boost v3p3 =3.6 v v3p3 =3.0 v vbat=4.0 v, v3p3=0, brn mode vbat=2.5 v, v3p3=0, brn mode lcd_vmode [1:0] = 2 , lcd_dac[4:0] = 1f, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.15 - 0.4 - 0.15 - 1.3 0.15 0.15 0.15 v v v v lcd_dac error. vlcd - vlcdnom dac=12 , with boost v3p3 = 3.6 v v3p3 = 3.0 v vbat = 2.5 v , v3p3 = 0 v , brn mode lcd_vmode [1:0] = 2, lcd_dac[4:0] = c, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.15 - 0.15 - 0.15 0.15 0.15 0.15 v v v lcd_dac error. vlcd - vlcdnom zero scale, with boost v3p3 = 3.6 v v3p3 = 3.0 v vbat = 4.0 v , v3p3 = 0 v , brn mode (see note 2) vbat = 2.5 v , v3p3 = 0 v , brn mode lcd_vmode [1:0] = 2, lcd_dac[4:0] =0, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.15 - 0.15 - 0.15 - 0.15 0.15 0.15 0.15 0.15 v v v v lcd_dac error. vlcd - vlcdnom full scale, no boost v3p3 = 3.6 v (see note 2) v3p3 = 3.0 v (see note 2) vbat = 4.0 v, v3p3 = 0 v , brn mode vbat = 2.5 v, v3p3 = 0 v , brn mode lcd_vmode [1:0] = 1, lcd_dac[4:0] = 1f, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 2.1 - 2.8 - 1.8 - 3.2 v v v v downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 148 rev 5 parameter condition min typ max unit lcd_dac error. vlcd - vlcdnom dac=12 , no boost v3p3 = 3.6 v v3p3 = 3.0 v vbat = 4.0 v, v3p3 = 0 v , brn mode vbat = 2.5 v, v3p3 = 0 v , brn mode lcd_vmode [1:0] = 1, lcd_dac[4:0] = c, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.5 - 1.1 - 0.15 2 - 1. 5 2 0.15 2 v v v v lcd_dac error. vlcd - vlcdnom zero scale, no boost v3p3 = 3.6 v v3p3 = 3.0 v vbat = 4.0 v, v3p3 = 0 v, brn mode vbat = 2.5 v, v3p3 = 0 v, brn mode lcd_vmode [1:0] = 1, lcd_dac[4:0] = 0, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.15 - 0.15 - 0.15 - 0.45 0.15 0.15 0.15 0.15 v v v v lcd_dac error. vlcd - vlcdnom full scale, with boost, lcd mode vbat = 4.0 v, v3p3 = 0 v vbat = 2.5 v, v3p3 = 0 v lcd_vmode [1:0] = 2, lcd_dac[4:0] = 1f, lcd_clk[1:0] =2, lcd_mode[2:0] =6 - 0.15 - 1.3 0.15 v v note s: 1. the following test conditions also apply to all parameters provided in this table: bypass capacitor cvlcd 0.1 f, test load rvlcd = 500 k , no display, all segdio pins configured as dio. 2. guaranteed by design; not production tested. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 149 6.4.14 vref table 109 shows the performance specifications for the adc reference voltage ( vref ). table 109 : vref performance specifications p arameter c ondition m in t yp max unit vref output voltage, vref(22 ) t a = 22 oc 1.193 1.195 1.197 v vref output voltage, vref(22 ) pll_fast =0 1.195 v vref output impedance vref_cal = 1, i load = 10 a, - 10 a 3.2 k vref power supply sensitivity vref / v3p3a v3p3a = 3.0 to 3.6 v - 1.5 1.5 mv/v vref input impedance vref_dis = 1 , vref = 1.3 v to 1.7 v 100 k vref chop step , trimmed vref(chop=01) ? vref(chop=10) - 10 0 10 mv vnom definition (see note 2) 2 )22 ( 1 )22 ( )22( )( 2 tc t tc t vref t vnom ? + ? + = v vnom temperature coefficients : tc1 = tc2 = trimt ? ? 95.4 275 trimt ? ? ? 00028 .0 557 .0 v/c v /c 2 vref(t) deviation from vnom(t) (see note 1): 62 10 )( )( )( 6 t vnom t vnom t vref ? - 40 +40 ppm /c vref aging 25 ppm / year notes: 1. guaranteed by design; not production tested. 2. this relationship describes the nominal behavior of vref at different temperatures, as governed by a second order polynomial of 1 st and 2 nd order coefficients tc1 and tc2. 3. for the parameters in this table, unless otherwise specified, vref_dis = 0, pll_fast =1. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 150 rev 5 6.4.15 adc converter table 110 . adc converter performance specifications p arameter c ondition m in t yp max unit recommended input range (vin - v3p3a ) - 250 250 mv peak voltage to current crosstalk ) cos( * 10 6 vcrosstalk vin vin vcrosstalk ? (see note 1) vin = 200 mv peak, 65 hz, on vadc10 (va) or vadc9 (vb) ? ? 71m6542f/g only. vcrosstalk = largest mea surement on ia p- ian or i bp - ibn - 10 10 v/v input impedance, no pre - amp vin= 65 hz 40 90 k a dc gain error vs %power supply variation 3.3/3 3 100 / 357 10 6 a p v v nv nout in pk d d vin=200 mv pk, 65 hz v3p3a=3.0 v, 3.6 v 50 ppm / % input offset iadc0=iadc1=v3p3a iadc0=v3p3a diff0_e =1, pre_e =0 diff0_e =0 , pre_e =0 - 10 - 10 10 10 mv mv thd @ 250mvpk name fir_len adc_div pll_fast mux_div a 0 0 0 3 b 1 0 0 2 c 0 0 1 11 d 1 0 1 6 e 2 0 1 4 f 0 1 0 2 g 0 1 1 6 h 1 1 1 3 j 2 1 1 2 v in = 65hz, 250mvpk, 64kpts fft, blackman harris window. a b - 82 c d - 84 e f - 83 g h - 86 j a - 75 b - 75 c - 75 d - 75 e - 75 f - 75 g - 75 h - 75 j - 75 db thd @ 20mvpk name fir_len adc_div pll_fast mux_div a 0 0 0 3 b 1 0 0 2 c 0 0 1 11 d 1 0 1 6 e 2 0 1 4 f 0 1 0 2 g 0 1 1 6 h 1 1 1 3 j 2 1 1 2 v in = 65hz, 20mvpk, 64kpts fft, blackman harris window. a - 85 b - 91 c - 85 d - 91 e - 93 f - 85 g - 85 h - 91 j - 93 db lsb size : name fir_len adc_div pll_fast mux_div a 0 0 0 3 b 1 0 0 2 c 0 0 1 11 d 1 0 1 6 e 2 0 1 4 f 0 1 0 2 g 0 1 1 6 h 1 1 1 3 j 2 1 1 2 vin=65hz, 20mvpk, 64kpts fft, blackman - harris window a 3470 b 406 c 3040 d 357 e 151 f 3470 g 3040 h 357 j 151 nv digital full - scale: name fir_len adc_div pll_fast mux_div a 0 0 0 3 b 1 0 0 2 c 0 0 1 11 d 1 0 1 6 e 2 0 1 4 f 0 1 0 2 g 0 1 1 6 h 1 1 1 3 j 2 1 1 2 a: 91125 b: 778688 c: 103823 d: 884736 e: 2097152 f: 91125 g: 103823 h: 884736 j: 2097152 lsb downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 151 note s: 1. guaranteed by design; not production tested. 2. unless stated otherwise, the following test conditions apply to all the parameters provided in this table: fir_len[1:0] =1, vref_dis =0, pll_fast =1, adc_div =0, mux_ div =6, lsb values do not include the 9 - bit left shift at ce input. 6.4.16 pre - amplifier for iap - ian table 111 : pre - amplifier performance specifications parameter condition min typ max unit differential gain vin=30mv differential vin=15mv differential (see note 1) t a = +2 5 ? c, v3p3=3.3 v, pre_e =1, fir_len =2, diff0 _e =1, 2520hz sample rate 7.8 7.8 7.92 7.92 8.0 8.0 v/v v/v gain variation vs v3p3 vin=30mv differential (see note 1) v3p3 = 2.97 v, 3.63 v - 100 100 ppm/% gain variation vs temp vin=30mv differential (see note 1) t a = - 40 ? c, 85 ? c 10 - 25 - 80 ppm/c phase shift, vin=30mv differential (see note 1) t a = 25 ? c, v3p3=3.3 v -6 6 mo preamp input current iadc0 iadc1 pre_e =1, fir_len =2 , diff0_e =1 2520hz sample rate, iadc0=iadc1=v3p3 4 4 9 9 16 16 ua ua preamp+adc thd vin=30mv differential vin=15mv differential t a = 25 ? c, v3p3=3.3 v , pre_e =1, fir_len =2 , diff0 _e =1, 2520hz sample rate. - 82 - 86 db db preamp offset iadc0=iadc1=v3p3+30mv iadc0=iadc1= v3p3+15mv iadc0=iadc1= v3p3 iadc0=iadc1= v3p3 - 15mv iadc0=iadc1= v3p3 - 30mv t a = 25 ? c, v3p3=3.3 v, pre_e =1, fir_len =2 , diff0 _e =1, 2520hz sample rate - 0.63 - 0.57 - 0.56 - 0.56 - 0.55 mv mv mv mv mv note s: 1. guaranteed by design; not production tested. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 152 rev 5 6.5 t iming s pecifications 6.5.1 flash memory table 112 : flash memory timing specifications p arameter c ondition m in t yp max unit flash write cycles - 40 c to +85 c 20,000 cycles flash data retention 25 c 85 c 100 10 years flash byte writes between page or mass erase operations 2 cycles write time per byte 21 s page erase (1024 bytes) 21 ms mass erase 21 ms 6.5.2 spi slave table 113 . spi slave timing specifications parameter condition min typ max unit spi setup time spi_di to spi_ck rise 10 ns spi hold time spi_ck rise to spi_di 10 ns spi output delay spi_ck fall to spi_d0 40 ns spi recovery time spi_csz fall to spi_ck 10 ns spi removal time spi_ck to spi_csz rise 15 ns spi clock high 40 ns spi clock low 40 ns spi clock freq spi freq/mpu freq 2.0 mhz/mhz spi transaction space spi_csz rise to spi_csz fall 4.5 mpu cycles 6.5.3 eeprom i nterface table 114 : eeprom interface timing p arameter c ondition m in t yp max unit write clock frequency (i 2 c) ckmpu = 4.9 mhz, using interrupts 310 khz ckmpu = 4.9 mhz, bit - banging dio2/3 pll_fast = 0 10 0 khz write clock frequency (3 - wire) ckmpu = 4.9 mhz pll_fast = 0 pll_fast = 1 160 500 khz downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 153 6.5.4 reset pin table 115 : reset pin timing p arameter c ondition m in t yp max unit reset pulse width 5 s reset pulse fall time (see note 1) 1 s note s: 1. guaranteed by design; not production tested. 6.5.5 rtc table 116 : rtc range for date p arameter c ondition m in t yp max unit range for date 2000 - 2255 y ear downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 154 rev 5 6.6 p ackage outline drawing s 6.6.1 64 - pin lqfp outline package drawing 11.7 12.3 0.60 typ. 1.40 1.60 11.7 12.3 0.00 0.20 9.8 10.2 0.50 typ. 0.14 0.28 pin no. 1 indicator + figure 47 : 64 - pin lqfp package outline downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 155 6.6.2 100 - pin lqfp package outline drawing controlling dimensions are in mm. figure 48 : 100 - pin lqfp package outline 1 15.7(0.618)16.3(0.641) 15.7(0.618)16.3(0.641) top view max. 1.600 0.50 typ. 14.000 +/- 0.200 0.225 +/- 0.045 0.60 typ> 1.50 +/- 0.10 0.10 +/- 0.10 side view downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 156 rev 5 6.7 package markings 1 71m6541d- igt.428ab 104224th 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 31 32 26 27 28 29 30 17 18 19 20 21 22 23 24 25 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6463 62 61 51 52 53 54 55 56 57 58 59 6049 50 1 71m6542g-igt110124tk 445ap 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 91 92 93 94 95 96 97 98 99 100 26 27 28 29 30 51 52 53 54 55 56 57 58 59 60 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 figure 49 . package markings (examples) figure 49 provides an example of the package markings for the 64 - pin and 100 - pin packages. package markings comprise three lines of text and are as described in table 117 and table 118 below. table 117 . 71m6541 package markings line no. markings description 1 71m6541d - part number (igt wraps to the next line) refer to table 122 . 2 igt.428ab the five characters to the right of the dot (i.e., 428ab) are the lot code. 3 104224th the first four digits to the left are the year and week of manufacture as yyww. in this example, the date code is 1042 which represents year 2010, week 42. the last four characters (i.e., 24th) are reserved for maxim internal use only. table 118 . 71m6542 package marki ngs line no. markings description 1 71m6542g - igt part number. refer to table 122 . 2 110124tk the first four digits to the left are the year and week of manufacture as yyww. in this example, the date code is 1101 which represents year 2011, week 1. the last four characters (i.e., 24tk) are reserved for maxim internal use only. 3 445ap a five character lot code. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 157 6.8 pinout diagrams 6.8.1 71m6541d/f /g lqfp - 64 package pinout 1 71m6541d 71m6541f 71m6541g 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 31 32 26 27 28 29 30 17 18 19 20 21 22 23 24 25 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6463 62 61 51 52 53 54 55 56 57 58 59 6049 50 spi_di /segdio38 spi_csz/ segdio36 com1com2 com3 com0 segdio27/com4 spi_do /segdio37 segdio26/com5 segdio25segdio24 segdio23 segdio22 segdio21 segdio20 segdio19 segdio1 /vpulse segdio3 /sdata opt_rx/segdio55 segdio14segdio13 segdio10 segdio11 segdio12 segdio9 segdio8/ di segdio7/ ypulse segdio6/ xpulse segdio5segdio4 segdio2 /sdck segdio0 /wpulse tx v3p3d v3p3sys xingndd vbatice_e opt_tx/segdio51 vbat_rtc e_rxtx /seg48 e_tclk /seg49 e_rst /seg50 rx vdd tmuxout/seg47 segdio45v3p3a gnda va pbvlcd test xout iapian reset tmux2out/seg46 segdio44 spi_cki /segdio39 vref ibpibn figure 50 : pinout for the 71m6541d/f /g (l qf p- 64 package ) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 158 rev 5 6.8.2 71m6542f/g lqfp - 100 package pinout 1 71m6542f 71m6542g 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 91 92 93 94 95 96 97 98 99 100 26 27 28 29 30 51 52 53 54 55 56 57 58 59 60 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 segdio17 tmuxout/seg47 spi_di /segdio38 tx v3p3d segdio1 /vpulse segdio3 /sdata spi_csz/ segdio36 v3p3sys com1com2 com3 com0 segdio45 nc xingndd vbatice_e segdio52 opt_tx/segdio51 va v3p3agnda nc pbvlcd test opt_rx/segdio55 xout iap ibn ian ibp segdio27/com4 spi_do /segdio37 segdio26/com5 segdio25segdio24 segdio23 segdio22 segdio21 segdio20 segdio19 segdio35segdio33 segdio32 segdio30 segdio29 segdio31segdio28 segdio34segdio18 gndavbat_rtc e_rxtx /seg48 e_tclk /seg49 e_rst /seg50 rxsegdio53 reset tmux2out/seg46 segdio44 segdio43 segdio42 segdio41 segdio40 spi_cki /segdio39 segdio16segdio15 segdio14 segdio13 segdio10 segdio11 segdio12 segdio9 segdio8/ di segdio7/ ypulse segdio6/ xpulse segdio5segdio4 segdio2 /sdck segdio0 /wpulse segdio54 vref ncnc nc nc vdd nc nc ncnc nc vb ncnc nc nc figure 51 : pinout for the 71m6542f/g ( lqfp - 100 package ) downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 159 6.9 pin d escriptions 6.9.1 power and ground pins pin types: p = power, o = output, i = input, i/o = input/output. the circuit number denotes the equivalent circuit, as specified under 6.9.4 i/o equivalent circuits . . table 119 : power and ground pins pin (64 pin) pin (100 - pin) name type circuit description 50 72, 80 gnda p C analog ground: this pin should be connected directly to the ground plane. 42 62 gndd p C digital ground: this pin should be connected directly to the ground plane. 53 85 v3p3a p C analog power supply: a 3.3 v power supply should be connected to this pin. v3p3a must be the same voltage as v3p3sys. 45 69 v3p3sys p C system 3.3 v supply. this pin should be connected to a 3.3 v power supply. 41 61 v3p3d o 13 auxiliary voltage output of the chip. in mission mode, this pin is con nected to v3p3sys by the internal selection switch. in brn mode, it is internally connected to vbat. v3p3d is floating in lcd and sleep mode. a 0.1 f bypass capacitor to ground must be connected to this pin. 40 60 vdd o C the output of the 2.5v regulator. this pin is powered in msn and brn modes. a 0.1 f bypass capacitor to ground should be connected to this pin. 57 89 vlcd o C the output of the lcd dac. a 0.1 f bypass capacitor to ground should be connected to this pin. 46 70 vbat p 12 battery backup pin to support the battery modes (brn, lcd). a battery or super - capacitor is to be connected between vbat and gndd. if no battery is used, connect vbat to v3p3sys. 47 71 vbat_rtc p 12 rtc and oscillator power supply. a battery or super - capacitor is to be connected between vbat and gndd. if no battery is used, connect vbat_rtc to v3p3sys. downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 160 rev 5 6.9.2 analog pins table 120 : analog pins pin (64 pin) pin (100 - pin) name type circuit description 55 54 44 43 87 86 68 67 iap - ian ibp - ibn i 6 differential or single - ended line current sense inputs: these pins are voltage inputs to the internal a/d converter. typically, they are connected to the outputs of current sensors. unused pins must be tied to v3p3a . pins ibp - ibn may be configured for communication with the remote sensor interface (71m6x01). when rmt_e = 1 ( i/o ram 0x2709[3] ), the ibp - ibn pins become balanced differential pair. if unused, rmt_e must be zero and ibp - ibn must tied to v3p3a. 52 -- 82 83 va vb ? i 6 line voltage sense inputs: these pins are voltage inputs to the internal a/d converter. typically, they are connected to the outputs of resistor di viders. unused pins must be tied to v3p3a. 56 88 vref o 9 voltage reference for the adc. this pin should be left unconnected (floating). 48 49 75 76 xin xout i o 8 crystal inputs: a 32 khz crystal should be connected across these pins. typically, a 15 pf capacitor is also connected from xin to gnda and a 10 pf capacitor is connected from xout to gnda. it is important to minimize the capacitance between these pins. see the crystal manufacturer datasheet for details. if an external clock is used, a 150 mv (p - p) clock sig nal should be applied to xin, and xout should be left unconnected. ? pin vb only available on 71m6542f/g . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 161 6.9.3 digital pins table 121 lists the digital pins. pin types: p = power, o = output, i = input, i/o = input/output, n/c = no connect. the circuit number denotes the equivalent circuit, as specified in 6.9.4 i/o equivalent circuits . table 121 : digital pins pin (64 - pin) pin (100 - pin) name type circuit function 4-7 12 C 15 com0 C com3 o 5 lcd common outputs. these four pins provide the select signals for the lcd display. 31 45 segdio0/wpulse i/o 3, 4, 5 multiple - use pins. configurable as either lcd segment driver or dio. alternative functions with proper selection of associated i/o ram registers are: segdio0 = wpulse segdio1 = vpulse segdio2 = sdck segdio3 = sdata segdio6 = xpulse segdio7 = ypulse segdio8 = di unused pins must be configured as outputs or terminated to v3p3/gndd. 30 44 segdio1/vpulse 29 43 segdio2/sdck 28 42 segdio3/sdata 27 41 segdio4 26 39 segdio5 25 38 segdio6/xpulse 24 37 segdio7/ypulse 23 36 segdio8/di 22 - 17 35 C 30 segdio[9:14] -- 29 - 27 segdio[15:1 7] -- 25 segdio[18] 16 - 10 24C 18 segdio[1 9 :25] -- 11 C4 segdio[28:35] 63 - 62 95 - 94 segdio[44:45] -- 99 C96 segdio[40:4 3] -- 52 segdio 52 -- 51 segdio53 -- 47 segdio54 9 17 segdio26/com5 i/o 3, 4, 5 multiple - use pins. configurable as either lcd segment driver or dio with alternative function (lcd common drivers). 8 16 segdio27/com4 3 3 spi_csz/segdio36 i/o 3, 4, 5 multiple - use pins. configurable as either lcd segment driver or dio with alternative function (spi interface). 2 2 spi_do/segdio37 1 1 spi_di/segdio38 64 100 spi_cki/segdio39 33 53 opt_tx/segdio51 i/o 3, 4, 5 multiple - use pins, configurable as either lcd segment driver or dio with alternative function (optical port/uart1) 32 46 opt_rx/segdio55 38 58 e_rxtx/seg48 i/ o 1, 4, 5 multiuse p ins . c onfigurable as either emulator port pins (when ice_e pulled high) or lcd segment drivers (when ice_e tied to gnd). 36 56 e_rst/seg50 37 57 e_tclk/seg49 o 4, 5 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 162 rev 5 pin (64 - pin) pin (100 - pin) name type circuit function 39 59 ice_e i 2 ice e nable. when zero, e_rst, e_tclk, and e_rxtx become seg50, seg49, and seg48 respectively. for production units, this pin should be pulled to gnd to disable the emulator port. 60 92 tmuxout/seg47 o 4, 5 multi ple -u se p in s. c onfigurable as either multiplexer/clock output or lcd segment driver using the i/o ram registers . 61 93 tmux2out/seg46 59 91 reset i 2 chip r eset . this input pin is used to reset the chip into a known state. for normal operation, this pin is pulled low. to reset the chip, this pin should be pulled high. this pin has an internal 30 a (nominal) current source pulldown . no external reset circuitry is necessary. 35 55 rx i 3 uart0 i nput. if this pin is unused it must be terminated to v3p3d or gndd. 34 54 tx o 4 uart 0 o utput 51 81 test i 7 enables production test . this pin must be grounded in normal operation. 58 90 pb i 3 pushbutton i nput. this pin must be at gndd when not active or unused. a rising edge sets the wf _pb flag. it also causes the part to wake up if it is in slp or lcd mode. pb does not have an internal pullup or pulldown resistor . -- 26, 40, 48, 49, 50, 63, 64, 65, 66, 73, 74, 77, 78, 79 , 84 nc n/c no connection. do not connect this pin . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 163 6.9.4 i/o equivalent circuits figure 52 : i/o equivalent circuits oscillator equivalent circuit type 8: oscillator i/o digital input equivalent circuit type 1: standard digital input or pin configured as dio input with internal pull - up gndd 110k v3p3d cmos input v3p3d digital input pin digital input type 2: pin configured as dio input with internal pull - down gndd 110k gndd cmos input v3p3d digital input pin digital input type 3: standard digital input or pin configured as dio input gndd cmos input v3p3d digital input pin cmos output gndd v3p3d gndd v3p3d digital output equivalent circuit type 4: standard digital output or pin configured as dio output digital output pin lcd output equivalent circuit type 5: lcd seg or pin configured as lcd seg lcd driver gndd lcd seg output pin to mux gnda v3p3a analog input equivalent circuit type 6 : adc input analog input pin comparator input equivalent circuit type 7: comparator input gnda v3p3a to comparator comparator input pin to oscillator gndd oscillator pin vref equivalent circuit type 9: vref from internal reference gnda v3p3a vref pin v2p5 equivalent circuit type 10: v2p5 from internal reference gndd v3p3d v2p5 pin vlcd equivalent circuit type 11: vlcd power gndd lcd drivers vlcd pin vbat equivalent circuit type 12: vbat power gndd power down circuits vbat pin v3p3d equivalent circuit type 13: v3p3d from v3p3sys v3p3d pin from vbat 10 10 downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet 164 rev 5 7 o rdering i nformation 7.1 71m6541d/f /g and 71m6542f/g table 122 . ordering information part p art description (package, typical a ccuracy) flash size packaging order number package marking 71m6541d 64 - pin lqfp lead - free, 0. 1% 32 kb bulk 71m6541d - igt/f 71m6541d - igt 71m6541d 64 - pin lqfp lead - free, 0. 1% 32 kb tape and reel 71m6541d - igtr /f 71m6541d - igt 71m6541f 64 - pin lqfp lead - free, 0. 1% 64 kb bulk 71m6541f - igt/f 71m6541f - igt 71m6541f 64 - pin lqfp lead - free, 0. 1% 64 kb tape and reel 71m6541f - igtr/f 71m6541f - igt 71m6541g 64 - pin lqfp lead - free, 0. 1% 128 kb bulk 71m6541g - igt/f 71m6541g - igt 71m6542f 100 - pin lqfp lead - free, 0. 1% 64 kb bulk 71m6542f - igt/f 71m6542f - igt 71m6542f 100 - pin lqfp lead - free, 0. 1% 64 kb tape and reel 71m6542f - igtr/f 71m6542f - igt 71m6542g 100 - pin lqfp lead - free, 0. 1% 128 kb bulk 71m6542g - igt/f 71m6542g - igt 71m6542g 100 - pin lqfp lead - free, 0. 1% 128 kb tape and reel 71m6542g - igtr/f 71m6542g - igt 8 related information users need these additional documents related to the 71m6541d/f /g and 71m6542f/g : ? 71m6541d /f /g and 71m6542f /g data sheet (this document) ? 71m6xxx d ata sheet ? 71m6541 demo board use rs manual ? 71m654 x software users guide 9 contact information for more information about maxim products or to check the availability of the 71m6 541d/f /g and 71m6542f/g , contact technical support at www.maximintegrated.com/support . downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet rev 5 165 appendix a: acronyms afe analog front end amr automatic meter reading ansi american national standards institute ce compute engine dio digital i /o dsp digital signal processor fir finite impulse response i 2 c inter - ic bu s ice in - circuit emulator iec international electrotechnical commission mpu microprocessor unit (cpu) pll phase - locked loop rms root mean square sfr special function register soc system on chip spi serial peripheral interface tou time of use uart universal asynchronous receiver/transmitter downloaded from: http:///
71m6541d/f/g and 71m6542f/g data sheet maxim integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim integrated product. no circuit patent licenses are implied. maxim integrated reserves the right to change the circuitry and specifications without notice at any time. the parametric values (min and max limits) shown in the electrical characterist ics table are guaranteed. other parametric values quoted in t his data sheet are provided for guidance. 166 ? 2015 maxim integrated products, inc. maxim integrated and the maxim integrated logo are trademarks of maxim integr ated products, inc. appendix b: revision history revision numbe r revision date description pages changed 1.0 3 /11 initial release 1.1 4/11 removed the information about 18mw typ consumption at 3.3v in sleep mode from the features section 1 updated the temperature measurement equation and temperature error parameters in table 99 141 2 11 /11 promoted 71m6542g to production l evel ( table 122 ) added references to 71m654 1g/ 2g throughout the document, as appropriate. added missing data sheet title header to odd and even pages. corrected errata detected since the previous v1.1 (see indicated pages changed). added section 6.7 on page 156 . 1, 9, 10, 27, 49 , 5 4 , 5 6 , 62, 9 7 , 1 20 3 10/13 added warning note on spi flash mode section, added page numbers and footers for the document, updated ien0 bit function and external mpu interrupts table, changed ceconfig bit 23 to reserved, corrected spi slave port diagram ( f igure 27), added 010 and 011 combination on the rcmd[4:0] bits table, updated the text description of the signal input pins section, combined columns 3 and 4 of table 34, updated the interrupt structure diagram, changed flshpg to pgadr on table 12, included additional lsbs for ce41a04 (table 85, table 87, table 90, and table 91), corrected the opt_txe active definition, updated the required ce code and settings notes about mux_div[3:0] all 4 3/14 removed future status from 71m6541g and removed 71m6541g - igtr/f in the ordering information table (table 122) 164 5 1/15 updated the benefits and features section 1 downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of 71M6541D-IGTRF

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X